Tuesday 18 November 2014

How to set start value of auto increment in MySQL?

The auto_increment is known as the seed value in MSSQL, if you need to change the sequence of your numbers then you can do so by running the following SQL command

ALTER TABLE tablename AUTO_INCREMENT=9999;

Change the table name to your actual table name and the 9999 to be your actual start value.

Alternatively if you are using phpMyAdmin then select your table and from the top menu select operations, under table options edit the AUTO_INCREMENT field.

This worked in phpMyAdmin version 4.2.7.1