📌  相关文章
📜  (errno: 150 "外键约束格式不正确") - 无论代码示例

📅  最后修改于: 2022-03-11 15:00:09.828000             🧑  作者: Mango

代码示例1
I ran into this same problem with HeidiSQL. The error you receive is very cryptic. My problem ended up being that the foreign key column and the referencing column were not of the same type or length.

The foreign key column was SMALLINT(5) UNSIGNED and the referenced column was INT(10) UNSIGNED. Once I made them both the same exact type, the foreign key creation worked perfectly.