MySQL: Reset the auto increment counter

In MySQL if you need to reset the AUTO_INCREMENT counter (i.e. After you did a bunch of deletes) you can run the following command:

ALTER TABLE MyTable AUTO_INCREMENT = 924;

This will cause 924 to be the next number given out for your AUTO_INCREMENT column.



Note: Replies will be formatted with PHP Markdown Extra syntax.

Name: Email (Not Required):
 
Logged IP: 3.143.0.157
To prevent spam please submit by clicking the kitten: