Magento-"SQLSTATE [23000]:违反完整性约束."客户更新 [英] Magento -- "SQLSTATE[23000]: Integrity constraint violation.." on customer update
问题描述
迁移服务器后,每次尝试更新客户信息时都会出错.我正在使用客户激活插件,但是禁用它之后,我仍然遇到相同的错误.
After migrating servers, I'm getting an error every time I try to update customer information. I'm using a customer activation plugin, but after disabling it, I still get the same error.
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '7-127' for key 2
怎么了?
即使在卸载插件后,在尝试保存客户信息时也会出现此错误.因此,这使我相信与Magento和/或我切换到的服务器相比,这是一个更大的问题.
Even after uninstalling the plugin, I get this error while trying to save customer information. So this leads me to believe its a bigger problem with Magento and/or the server I'm switched to.
我检查了Magento的日志,并多次收到此通知:
I checked the Magento's log and I'm getting this Notice multiple times:
ERR (3): User Notice: Sorry, your PCRE extension does not support UTF8 which is needed for the I18N core in ../httpdocs/store/lib/Zend/Locale/Format.php on line 769
这相关吗?
推荐答案
问题是因为在迁移数据库时,mysql 有帮助地重新启动了自动递增的id列,并且Magento进行了一些硬编码假设ID从零开始的值.导入数据时需要禁用foreign_key_checks.
The issue is because when you migrated your database, mysql helpfully restarts the id columns that are auto-increment and Magento has some hardcoded values that assume that IDs start from zero. You need to disable foreign_key_checks when you import the data.
这篇关于Magento-"SQLSTATE [23000]:违反完整性约束."客户更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!