如何成功导出magento 1.9数据库(mysql 5.6)并导入mysql 5.5

9jyewag0  于 2021-06-18  发布在  Mysql
关注(0)|答案(1)|浏览(394)

我已经转储了一个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 )on delete cascade on up)0.015秒
请指导我如何正确地做到这一点,非常感谢任何帮助!

avkwfej4

avkwfej41#

只需禁用密钥检查

SET FOREIGN_KEY_CHECKS=0;

在sql转储的顶部。
迁移完成后,还要重新启用它们

SET FOREIGN_KEY_CHECKS=1;

相关问题