当前位置:   article > 正文

[23000][1452] Cannot add or update a child row: a foreign key constraint fails (`test2`.`#sql-1238_5

[23000][1452] cannot add or update a child row: a foreign key constraint fai

在建立外键关系时,出现该报错信息:

[23000][1452] Cannot add or update a child row: a foreign key constraint fails (`test2`.`#sql-1238_50`, CONSTRAINT `fk_student_ID` FOREIGN KEY (`ID`) REFERENCES `achievement` (`ID`))

原因:

建立外键时,子表中存在父表没有的数据。

如下声明:本文内容由网友自发贡献,转载请注明出处:【wpsshop博客】

推荐阅读
相关标签