MYSQL创建外键遇见错误

1:两个字段类型不一致,导致创建外键引用错误:

    ERROR 1215 (HY000): Cannot add foreign key constraint

[2020-05-25 15:51:11] [HY000][1215] Cannot add foreign key constraint
[2020-05-25 15:51:11] [HY000][150] Create table 'xxxx/#sql-60_16' with foreign key constraint failed. There is no index in the referenced table where the referenced columns appear as the first columns.
[2020-05-25 15:51:11] [HY000][1215] Cannot add foreign key constraint

  

posted @ 2020-05-25 16:01  bf378  阅读(315)  评论(0编辑  收藏  举报