Select Page

I spend a lot of time on various Open-Source, web platform, web sites (I.E. OpenEMM, WordPress and others). I often see people asking about how to change the auto-increment number in MySQL. This is usually asked when someone makes a change to User ID fields.

Most people can find this information out by reading the MySQL documentation or searching the internet. However, if people are searching the internet for this issue, then why not find the answer on my web site?

The command is quite easy.

It can be run from the command line by using the following command:

mysql> ALTER TABLE table_name AUTO_INCREMENT = start_number

If you are using phpMyAdmin, you will use the same command, but will not see the mysql prompt:

ALTER TABLE table_name AUTO_INCREMENT = start_number