Tip: Setting the autoincrement to start from a specified number

In order to reset the auto_increment, in a situation where you want the auto increment to start from a number other than 1, use the following query

ALTER TABLE theTableInQuestion AUTO_INCREMENT=1001

after executing this query future insertions will be numbered from 1001 (unless you have no rows numbered greater than 1001)

 

More MySQL tips