1452 - Cannot add or update a child row: a foreign key constraint fails
Mysql错误1452 - Cannot add or update a child row: a foreign key constraint fails报错主要原因:外键约束出错,意思就是对表进行设置外键时出错。主要原因分析原因一:添加的外键列与另一个表的唯一索引列(一般是主键)的数据类型不同原因二:要添加外键的表类型与另一个表的存储引擎是不是都为innodb引擎#查看表引擎法一: show create table 表名;法二:show table status from 数据库 w
原创
2021-04-13 10:32:06 ·
2562 阅读 ·
0 评论