AFTER MySql restart : #1452 - Cannot add or update a child row: a foreign key constraint fails

半城伤御伤魂 提交于 2019-12-11 03:23:15

问题


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.

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


回答1:


I had the same problem with MAMP :/ I don't know about the cause but "FLUSH TABLE" solved it.



来源:https://stackoverflow.com/questions/10363611/after-mysql-restart-1452-cannot-add-or-update-a-child-row-a-foreign-key-co

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!