首页
IT
登录
6mi
u
盘
搜
搜 索
IT
Mysql添加数据时失败 Cannot add or update a child row: a foreign key constraint fails
Mysql添加数据时失败 Cannot add or update a child row: a foreign key constraint fails
xiaoxiao
2021-03-25
66
用SSM 框架时 添加数据时遇到的问题 Cannot add or update a child row: a foreign key constraint fails
原因:
设置的外键与外键对应的表的主键值不匹配(换句话说你添加外键值在他所对的表中不存在)。
解决方法:
找出不匹配的值修改。
或者清空两表数据。
转载请注明原文地址: https://ju.6miu.com/read-36781.html
技术
最新回复
(
0
)