Forcing auto_increment on MySQL?

redarrow

Expert Member
Joined
Dec 30, 2005
Messages
2,411
Reaction score
57
Location
Port Elizabeth, South Africa
Anyone know how I can force or reset the "auto_increment" value in a MySQL table?

In my database I erased some entries which I had accidentally duplicated (due to a bug in my code) .. but now when I insert a new entry the auto_increment value is continuing where it left off... That is to say, the highest current auto incremented value in the table might be 5 but if I insert a new entry it gets assigned 9 and carries on from there..

How can I force MySQL to always continue from the highest current entry? :confused:


Thanks.
 
Top
Sign up to the MyBroadband newsletter
X