MySQL Error 1215: Cannot add foreign key constraint

前端 未结 30 2846
予麋鹿
予麋鹿 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:15

    For others same error may not always be due to column type mismatch, you can find out more information about a mysql foriegn key error by issuing command

    SHOW ENGINE INNODB STATUS;
    

    you may find a error near the top of the printed message something like

    Cannot find an index in the referenced table where the referenced columns appear as the first columns, or column types in the table and the referenced table do not match for constraint.

提交回复
热议问题