我遵循这里的建议,但在将我的数据库导入到本地XAMPP安装后,我仍遇到相同的问题。外键约束 - DB不会导入。 - Magento
我的SQL转储被包裹在这些标签:
SET FOREIGN_KEY_CHECKS=0;
// FULL DB DUMP
SET FOREIGN_KEY_CHECKS=1;
即使如此,我收到此错误信息:
Error
SQL query:
ALTER TABLE `mage_catalog_eav_attribute` ADD CONSTRAINT `FK_CATALOG_EAV_ATTRIBUTE_ID` FOREIGN KEY (`attribute_id`) REFERENCES `mage_eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE ;
MySQL said: Documentation
#1452 - Cannot add or update a child row: a foreign key constraint fails (`myDB_NAME`.<result 2 when explaining filename '#sql-2e0_5a'>, CONSTRAINT `FK_CATALOG_EAV_ATTRIBUTE_ID` FOREIGN KEY (`attribute_id`) REFERENCES `mage_eav_attribute` (`attribute_id`) ON DE)
谁能帮助我明白,我需要禁用这些检查还有什么,还是防止这个错误?
我正在运行Magento 1.4.2,并通过xampp使用phpmyadmin导入。
谢谢,这绕过了我遇到的问题。 – danchet 2012-01-08 18:12:04