I have a mysql innoDB table with over 6000 records. The primary key (ID) is set to be auto_incremented. At this time the auto_increment value was 41804.
I inserted over 2000 records through insert statements, and found some of the queries to have some data problems. By this time the auto_increment value had changed to 42500.
I fixed the data issue in the insert statements, deleted the newly inserted records from the table and changed the auto_increment value to 41804 (to be incremented by 10) with
alter table mytable auto_increment = 41804
I ran the insert statements again - this time I got an error code: 1062 - Duplicate entry '320-41804' for key 'PRIMARY'
The max ID value is 41794 and the auto_increment value is 41804 - there is no record with ID value 41804 - but i'm still getting duplicate key error.
can any one shed some light on this?
much appreciated.