我有一个奇怪的案例: 它有效:
Create table `testasd`(
`asd` int(10) NOT NULL,
primary key (`asd`)
)
但这不起作用:
Create table `test1`(
`asd` int(10) NOT NULL,
primary key (`asd`)
)
Cannot add foreign key constraint
最佳答案
mysql返回的错误具有误导性
要查找具体错误,请运行以下命令:
SHOW ENGINE INNODB STATUS;
关于mysql - 无法创建表 - 无法添加外键约束,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40376560/