mysql - 通过 SSH 导入 magento 数据库时出错

标签 mysql magento command-line ssh terminal

尝试通过 SSH 转储 magento 数据库时出现以下错误

ERROR 1452 (23000) at line 82966: Cannot add or update a child row: a foreign key constraint fails (`aloodawp/#sql-4136_fcf760`, CONSTRAINT `FK_EAV_ATTRIBUTE_ENTITY_TYPE_ID_EAV_ENTITY_TYPE_ENTITY_TYPE_ID` FOREIGN KEY (`entity_type_id`) REFERENCES `eav_entity_type` (`entity_type_id`) ON DELET)

我不是 shell 或 mysql 的专家,知道基础知识并且以前从未遇到过这个问题

已解决

Are you getting this error when you dump, or when you are reading the dump back in? SET FOREIGN_KEY_CHECKS=0; and SET FOREIGN_KEY_CHECKS=1; around your dump should solve the problem. 

最佳答案

将评论转换为答案:

您是否在转储时或在读回转储时遇到此错误?

SET FOREIGN_KEY_CHECKS=0;

SET FOREIGN_KEY_CHECKS=1;

在你的转储周围应该可以解决问题。

关于mysql - 通过 SSH 导入 magento 数据库时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11942420/

相关文章:

php - 如何从mysql中取出一个变量,然后从前一个变量中取出另一个变量?

mysql - 获取24小时时间范围内的记录

php - Magento:在设置脚本中向分组产品添加新属性

Magento 1.9.1.1 优惠券代码无效

linux - 在 Linux 命令行中调用 R 函数

php - 使用 PHP 将 Mysql 中的日期显示为月年格式

mysql - 用于匹配同一列中的多个值的 SQL 查询

magento - 使用 CSV 在 Magento 中导入产品时如何正确使用分号

ubuntu - 从两个文件夹中删除公共(public)文件

command-line - 如何使用 sed 仅替换文件中的第一次出现?