gpt4 book ai didi

mysql - 无法创建表 - 无法添加外键约束

转载 作者:行者123 更新时间:2023-11-29 20:04:59 24 4
gpt4 key购买 nike

我有一个奇怪的案例:它有效:

    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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com