php - 修复 Innodb Integrity 约束违规 : 1452

标签 php mysql magento foreign-keys constraints

<分区>

我可以使用什么 Innodb 查询来纠正以下问题?

SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (mrvallar_magdb.catalog_product_entity_varchar, CONSTRAINT CATALOG_PRODUCT_ENTITY_VARCHAR_IBFK_3 FOREIGN KEY (entity_id) REFERENCES catalog_product_entity_orig (entity_id) ON DELETE)

最佳答案

您尝试使用 catalog_product_entity_orig 中不存在的 entity_id 值在 catalog_product_entity_varchar 中插入/更新记录

您需要将该实体插入到“orig”表中,然后才能在“varchar”表中引用它

关于php - 修复 Innodb Integrity 约束违规 : 1452,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12628097/

相关文章:

php - mysql 左连接和返回已连接和未连接

python - Django object.filter 没有加载所有结果

php - undefined variable : image_event_id

magento - 无法在 Magento 中使用管理员登录

list - Magento "Unable to list current working directory"

php - 使用php上传文件并在mysql列中插入其路径

PHP 多维数组从 MySQL 查询乱序

python - 在 Pandas 数据框中加入关系表的层次结构

mysql - Magento - 如何在 magento 发票网格中加入发票项目

php - 构建 SMART mySQL 和 PHP 搜索引擎的最佳方法?