Magento Forum

   
Mysql Dump Import
 
Daim
Sr. Member
 
Total Posts:  172
Joined:  2008-01-08
Germany
 

Hello,

i made a database dump with phpmyadmin from my magento shop. Now I have trouble to Import this Dump. I become Messages like

Cannot add or update a child row: a foreign key constraint fails (`magento/#sql-1100_1ae`, CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_DECIMAL_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE)

Any idea?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Mark_Kimsal
Sr. Member
 
Total Posts:  186
Joined:  2007-09-12
Michigan, USA
 

Add this line to the top of your dump file:

SET FOREIGN_KEY_CHECKS 0;

And this line to the bottom:

SET FOREIGN_KEY_CHECKS 1;

There should be some checkboxes in PMA that deal with foreign key constraints.  If not, then this is a PMA bug.  Incidentally, this is why I never used postgresql, by default it didn’t come with any tools to dump and restore tables with Fkeys, it always got the order wrong.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Daim
Sr. Member
 
Total Posts:  172
Joined:  2008-01-08
Germany
 

thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
 
toxicshit
Jr. Member
 
Total Posts:  19
Joined:  2007-11-01
 

ive try’d this solution but it doesnt work for me i keep getting the foreign key contraints ?

doe someone have a better sql dump for me than the one on the magento site ?

Greetings Erwin.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top