MySQL Error 1215: Cannot add foreign key constraint

前端 未结 30 2820
予麋鹿
予麋鹿 2020-11-22 01:37

I am trying to forward engineer my new schema onto my db server, but I can\'t figure out why I am getting this error. I\'ve tried to search for the answer here, but everyth

30条回答
  •  时光说笑
    2020-11-22 02:10

    I experienced this error for a completely different reason. I used MySQL Workbench 6.3 for creating my Data Model (awesome tool). I noticed that when the column order defined in the Foreign Key constraint definition does not fit the table column sequence this error is also generated.

    It took me about 4 hours of trying everything else but checking that.

    Now all is working well and I can get back to coding. :-)

提交回复
热议问题