How to manually set seed value as 1000 in MySQL

user186164 picture user186164 · Oct 8, 2009 · Viewed 14.1k times · Source

I am using MySQL 5. I need to set the seed value as 1000 for my auto increment field. How can I set it?

Answer

Julien Lebosquain picture Julien Lebosquain · Oct 8, 2009

To set when creating your table:

CREATE TABLE xxx(...) AUTO_INCREMENT = 1000;

To set after creating the table:

ALTER TABLE xxx AUTO_INCREMENT = 1000;