Integrity constraint violation: 1062 Duplicate entry '1' for key 'PRIMARY'

后端 未结 4 1789
旧时难觅i
旧时难觅i 2021-02-19 09:23

I have a databse problem where i get Integrity constraint violation: 1062. I tried some things on my own but it didtn work so now i am asking you guys to see if you people can h

4条回答
  •  误落风尘
    2021-02-19 10:05

    in my case the error is:

    SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY'

    the solution is to Empty/Truncate all records of the table in question

    The problem happens when auto-increment is disabled on the primary-key of that table or the data-type is wrong.

    partially credited to https://magento.stackexchange.com/questions/56354/admin-error-sqlstate23000-integrity-constraint-violation-1062-duplicate-ent

提交回复
热议问题