php - Magento 目录规则违反 MySQL 完整性约束错误

标签 php mysql magento

长时间等待目录规则应用后,我收到此错误:

Next exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '44657-0-2' for key 'PRIMARY', query was: INSERT INTO catalog_product_index_price_tmp SELECT catalog_product_index_price_final_tmp.entity_id, catalog_product_index_price_final_tmp.customer_group_id, catalog_product_index_price_final_tmp.website_id, catalog_product_index_price_final_tmp.tax_class_id, catalog_product_index_price_final_tmp.orig_price AS price, catalog_product_index_price_final_tmp.price AS final_price, catalog_product_index_price_final_tmp.min_price, catalog_product_index_price_final_tmp.max_price, catalog_product_index_price_final_tmp.tier_price, catalog_product_index_price_final_tmp.group_price FROM catalog_product_index_price_final_tmp'

我尝试重建索引、重新启动 MySQL 并且仍然是一样的,在等待大约 40 分钟以应用一条规则后,我得到了这样的错误。

我也在本地尝试使用相同的数据库和代码来应用规则,它们运行良好。

我正在运行 Magento 1.14,这是在从 Magento 1.11 升级后发生的,但只发生在一台服务器上,而不是在测试服务器上,也不是在具有相同数据库和代码的本地。

关于我可以做什么来应用规则有什么建议吗? 我需要在服务器上检查任何配置吗?

提前致谢。

最佳答案

在管理员上:

System > Configuration > Index Management > Index Options

将所有索引更改为计划时更新,重新索引所有索引,应用目录规则。

这解决了我的问题。

希望对你有帮助。

关于php - Magento 目录规则违反 MySQL 完整性约束错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33069613/

相关文章:

php - 将 mysql echo 作为 ajax 中的错误返回

php - 日期不按 laravel 中指定的那样工作

php - 为什么页面仅在首页加载时才获取 undefined variable ?

mysql - 如何根据我没有的列值选择行,但它与我有的列值存在于同一行中?

magento - 如何在 Magento 的内部搜索中制作动态规范标签?

magento - 在 Magento 购物车中设置最低价格

php - 上传前检查文件是 zip 类型

ubuntu - PHP 启动 : Unable to load dynamic library (NEW RELIC)

java - 在 Java 上处理 MySQL 查询时处理断电?

web-services - Magento 1.7.0.0 上的 SOAP V2 网址是什么