问题描述
在MySql重新启动之后,当我尝试更新或插入行时出现此错误:#1452-无法添加或更新子行:外键约束失败.
AFTER MySql restart i get the this error when I try to update or insert a row : #1452 - Cannot add or update a child row: a foreign key constraint fails.
奇怪的是,当我使用phpMyAdmin删除并再次添加键约束时,问题消失了.另外,我只在MAMP中遇到此问题,而在WAMP中则没有,直到现在也没有在任何其他服务器上遇到此问题.我使用MySQL 5.5.9,有人可以为此提供解决方案吗?谢谢,彼得
The strange thing is that when I remove and add the key constraint again with phpMyAdmin the problem is gone. Also this I only have this problem with MAMP, not with WAMP, and also not on any other server until now.I use MySQL 5.5.9 , can anyone give a solution for this ?Thanks,Peter
推荐答案
我在MAMP上也遇到了同样的问题:/我不知道原因,但是"FLUSH TABLE"解决了它.
I had the same problem with MAMP :/I don't know about the cause but "FLUSH TABLE" solved it.
这篇关于MySql restart之后:#1452-无法添加或更新子行:外键约束失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!