gpt4 book ai didi

mysql - 如何成功导出 Magento 1.9 数据库(MySQL 5.6)并将其导入 MySQL 5.5

转载 作者:行者123 更新时间:2023-11-29 16:56:39 25 4
gpt4 key购买 nike

我已转储 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

Error Code: 1452. Cannot add or update a child row: a foreign key constraint fails (dailynuc_dailynu.#sql-1466_121c50b, CONSTRAINT affiliateplusprogram_category_ibfk_2 FOREIGN KEY (category_id) REFERENCES catalog_category_entity (entity_id) ON DELETE CASCADE ON UP) 0.015 sec

请指导我如何正确执行此操作,非常感谢您的帮助!

最佳答案

只需使用

禁用 key 检查
SET FOREIGN_KEY_CHECKS=0;

位于 sql 转储的顶部。

迁移完成后也将其重新打开

SET FOREIGN_KEY_CHECKS=1;

关于mysql - 如何成功导出 Magento 1.9 数据库(MySQL 5.6)并将其导入 MySQL 5.5,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52523575/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com