Mysql reset auto increment value

by Mohan 2014-04-19 18:52:34



Mysql reset auto increment value



Here are simple example to set auto increment value in a mysql table after deleting records.



ALTER TABLE table_name AUTO_INCREMENT = 1;

This allows to set auto increment value to start from 1.



TRUNCATE TABLE table_name;

This deletes all the records in mysql table and auto increment value is set to 0.


1409
like
0
dislike
0
mail
flag

You must LOGIN to add comments