MySQL Forums
Forum List  »  Newbie

Duplicate Entry PRIMARY
Posted by: John Crenshaw
Date: April 01, 2022 08:40PM

I am working with a commercial in confidence developed by someone else. Getting the following after the PC crashed while processing and then auto restarted;

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '11026' for key 'customers.PRIMARY'

I have little idea on how SQL works but have determined in MySQL Workbench 8.0 that the database in local (MYSQL80). In the schema when I look at the rows for customers I can see rows with ID, 11025, 11024, 11023 etc.

So there appears to be no primary ID 11026, and the error is caused when the database tries to create another row. So is this a corruption caused by the crash?

I've read you can put in a command to ignore duplicates but would rather try and fix the issue.

Options: ReplyQuote


Subject
Written By
Posted
Duplicate Entry PRIMARY
April 01, 2022 08:40PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.