Magento: Cannot add or update a child row: a foreign key constraint fails

I am in the stage of migrating my local database of magento to public when I have encountered this error.

How did it happen:
1.) I use phpmyadmin3.2 to export the sql statements.
2.) In my host mysql's phpmyadmin, I have executed the dump statements.


And I got the following error:
SQL query:

 --
-- Constraints for table `eav_entity_attribute`
--
ALTER TABLE `eav_entity_attribute`
ADD CONSTRAINT `FK_EAV_ENTITY_ATTRIBUTE_ATTRIBUTE`
FOREIGN KEY ( `attribute_id` )
REFERENCES `eav_attribute` ( `attribute_id` )
ON DELETE CASCADE ON UPDATE CASCADE ,
ADD CONSTRAINT `FK_EAV_ENTITY_ATTRIBUTE_GROUP`
FOREIGN KEY ( `attribute_group_id` )
REFERENCES `eav_attribute_group` ( `attribute_group_id` )
ON DELETE CASCADE ON UPDATE CASCADE


MySQL said: Documentation
#1452 - Cannot add or update a child row:
a foreign key constraint fails
(`db294125795/#sql-1357_3238a8`,
CONSTRAINT `FK_EAV_ENTITY_ATTRIBUTE_ATTRIBUTE`
FOREIGN KEY (`attribute_id`)
REFERENCES `eav_attribute` (`attribute_id`)
ON DELETE CASCADE ON UPDATE CASCADE)


So what did I do:
1.) I simply re-dumped my local database sql statements using phpmyadmin this time checking "Disable foreign key contraints checkbox" and it executed without error.

Site Search

Who's Online

Abbiamo 23 visitatori e nessun utente online

Stats

Visite agli articoli
161158
banner mym
banner mym