Tuesday, August 23, 2011

Magento errors SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry during upgrade

If you are upgrading your Magento store and you have received this error:

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry

The solution is to modify your /app/etc/config.xml file with the following:

Original statement
SET NAMES utf8

Modified statement
SET NAMES utf8; SET FOREIGN_KEY_CHECKS=0; SET UNIQUE_CHECKS=0;

Twitter: @brentwpeterson on Twitter
Linkedin: http://www.linkedin.com/in/brentwpeterson
View My Magento Profile

5 comments:

  1. Hi, thank you for this fix. Should we remove these lines after the upgrade, or we should keep them all the time.

    ReplyDelete
  2. Deskin, yes you can change it back to the original

    ReplyDelete
  3. Just leave the lines in.. save some time with useless relationship errors.

    ReplyDelete
  4. so many times , i get similar issue when login. is that same solution for this problem. Please suggest me ....


    Thanks

    ReplyDelete
  5. This comment has been removed by the author.

    ReplyDelete