ServerTune

Browse by category

Search    |    Advanced search

MySQL error on importing backup database to a new server

If you get the following eror when trying to import your data:

#1452 - Cannot add or update a child row: a foreign key constraint fails (`ofirep_tienda/#sql-121f_18e12`, CONSTRAINT `FK_CATALOG_CATEGORY_EMTITY_INT_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE)

Do the following:
  1. Backup your databse
  2. Edit the *.sql archive, and add this directive above the very first line of your database:
    SET FOREIGN_KEY_CHECKS = 0;
  3. Add the following directive below the very last line of your DB
    SET FOREIGN_KEY_CHECKS = 1;
 
 
Add comment
 
Views: 992
 
Votes: 0
 
Comments: 0
 

Other articles in this Category

RSS