Parker Smith Software

 
 

resetting the auto_increment counter in MySQL

By Brian Webb

28 May 2008

Have you ever had a table where you wanted to drop all the information and reset the id field? Say you have the auto_increment value at 1024 and you want to drop all the data and make all new rows start from 1. Or maybe you have the auto_increment value at 1024 and you want to jump it to have all new rows start from 10024. Here is how:

1
2

ALTER TABLE {table_name} AUTO_INCREMENT = {new_value};

No Spam: 6 + 0 =