MySQL cannot create foreign key constraint

后端 未结 12 2231
夕颜
夕颜 2020-12-08 12:39

I\'m having some problems creating a foreign key to an existing table in a mysql database.

I have the table exp:

+-------------+--------         


        
12条回答
  •  一整个雨季
    2020-12-08 13:13

    Just throwing this into the mix of possible causes, I ran into this when the referencing table column had the same "type" but did not have the same signing.

    In my case, the referenced table colum was TINYINT UNSIGNED and my referencing table column was TINYINT SIGNED. Aligning both columns solved the issue.

提交回复
热议问题