Reset an auto increment row in mySQL

by Ranganathan 2012-08-27 17:55:52

1) Drop the table and recreate it.
DROP TABLE myTable;
CREATE TABLE myTable( ... etc ...

2) Alter the auto_increment to a specified index
ALTER TABLE myTable AUTO_INCREMENT = 1;

3) Truncate the table to delete all rows and reset auto_increment
TRUNCATE TABLE myTable
848
like
0
dislike
0
mail
flag

You must LOGIN to add comments