how to reset the auto_increment value for MySQL

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};

Thats it.

Comments

Hero

about 1 year ago

Very good site! I like it! Thanks! . [URL=http://my-test-doorway.myhost.com].[/URL]

Hero

about 1 year ago

Very good site! I like it! Thanks! . [URL=http://my-test-doorway.myhost.com].[/URL]

Name

Email

URL

Comment