Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email

Magento Forum

Trying to install database locally, getting foreign key constraint errors
Sr. Member
Total Posts:  77
Joined:  2009-06-22
Sydney, Australia

Okay so I have a fairly massive database to install locally, it’s around 300MB.

I’m using bigdump.php ( to do this, and everything is fine until I run into the following error

Error at the line 6487ADD CONSTRAINT `FK_DIRECTORY_REGION_NAME_REGIONFOREIGN KEY (`region_id`) REFERENCES `directory_country_region` (`region_id`) ON DELETE CASCADE ON UPDATE CASCADE;
QueryALTER TABLE `directory_country_region_name`
Cannot add or update a child rowa foreign key constraint fails (`magento`.`#sql-1ae4_6b`, CONSTRAINT `FK_DIRECTORY_REGION_NAME_REGIONFOREIGN KEY (`region_id`) REFERENCES `directory_country_region` (`region_id`) ON DELETE CASCADE ON UPDATE CASCADE)

I have read this page and done what it asks, yet I still get this error. Has anyone else observed this problem?

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