Reputation: 85
I get the following error while trying to dump a magento database via SSH
ERROR 1452 (23000) at line 82966: Cannot add or update a child row: a foreign key constraint fails (`aloodawp/#sql-4136_fcf760`, CONSTRAINT `FK_EAV_ATTRIBUTE_ENTITY_TYPE_ID_EAV_ENTITY_TYPE_ENTITY_TYPE_ID` FOREIGN KEY (`entity_type_id`) REFERENCES `eav_entity_type` (`entity_type_id`) ON DELET)
im not really an expert with shell or mysql know the basics & never encountered this problem before
SOLVED
Are you getting this error when you dump, or when you are reading the dump back in? SET FOREIGN_KEY_CHECKS=0; and SET FOREIGN_KEY_CHECKS=1; around your dump should solve the problem.
Upvotes: 2
Views: 667
Reputation: 23205
Converting comment to answer:
Are you getting this error when you dump, or when you are reading the dump back in?
SET FOREIGN_KEY_CHECKS=0;
and
SET FOREIGN_KEY_CHECKS=1;
around your dump should solve the problem.
Upvotes: 1