MySQL cannot create foreign key constraint

后端 未结 12 2225
夕颜
夕颜 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:15

    As mentioned @Anton, this could be because of the different data type. In my case I had primary key BIGINT(20) and tried to set foreight key with INT(10)

提交回复
热议问题