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
What is wrong?
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.
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
Is this relevant?
Fixed: SQLSTATE[23000]: Integrity constraint violation: 1052 This issue occurs when more than one table are having the same column name and in a join query, the column name is being used without the alias of the table name.
In order to remedy this error, you will need to insert the value that you attempted to place in the child table into the parent table first. Once inserted as a parent row, you can go back and insert the value into the child table.
Integrity constraint violations occur when an insert, update, or delete statement violates a primary key, foreign key, check, or unique constraint or a unique index.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With