Tuesday, January 25, 2011

MySQL - Restart - AutoInc resets to zero

I noticed fact recently that MySQL Table autoincrement Id value resets to zero, if table is empty.

solution to this is, you can reset the counter to

mysql> ALTER TABLE tbl AUTO_INCREMENT = 1000;

No comments: