Carson Myers Carson Myers - 4 months ago 10
MySQL Question

can I reset auto_increment field in mySql?

Can I reset the auto-increment index of a MySQL table so that it starts counting from zero again?

I deleted all the rows in the table--how can I reset that counter as well?

Answer

To delete all rows from a MySQL table AND reset the auto_increment value, use the truncate command.

http://www.tutorialspoint.com/sql/sql-truncate-table.htm

Comments