我已转储MySQL(5.6.40-MySQL Community Server(GPL))数据库(Magento 1.9),并尝试将其导入MySQL(5.5.55-38.8-log-Percona Server(GPL),版本38.8 ,修订版11f5bbd),在导入期间,大多数脚本会正常执行,但其中一些脚本会失败,如下所示:
10:48:04
ALTER TABLE `affiliateplusprogram_category`
ADD CONSTRAINT `affiliateplusprogram_category_ibfk_1` FOREIGN KEY
(`program_id`) REFERENCES `affiliateplusprogram` (`program_id`) ON DELETE
CASCADE ON UPDATE CASCADE, ADD CONSTRAINT
`affiliateplusprogram_category_ibfk_2` FOREIGN KEY (`category_id`) REFERENCES
`catalog_category_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `affiliateplusprogram_category_ibfk_3` FOREIGN KEY (`store_id`)
REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
错误代码:1452。无法添加或更新子行:外键约束 失败(
dailynuc_dailynu
。#sql-1466_121c50b
,约束affiliateplusprogram_category_ibfk_2
外键(category_id
)参考catalog_category_entity
(entity_id
)上删除串联 0.015秒
请指导我如何正确执行此操作,非常感谢您提供任何帮助!
答案 0 :(得分:0)
仅通过
禁用按键检查SET FOREIGN_KEY_CHECKS=0;
在sql dump的顶部。
在迁移完成后也将它们重新打开
SET FOREIGN_KEY_CHECKS=1;