Friday, January 25, 2013

Alter Table AUTO_INCREMENT

How to set the AUTO_INCREMENT value for a table?

ALTER TABLE <table> AUTO_INCREMENT = <value>;

For an example, if you have a table called users and you want to change its auto increment value to 1001, the following MySQL query will do the job:

alter table users auto_increment = 1001

You'll find more information in MySQL documentation.

No comments:

Post a Comment