Change MySQL Auto-Increment Number

by | Dec 15, 2011 | Linux Administrator

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

Logo with image

About the Author:

WebDevRobert

Innovative Technology Professional, working on IT/OT Convergence & Security, in the foundry industry.

Website Designer/Developer since the mid 1990’s.

Apple, Linux and Network Administrator since the late 1990’s.

Background includes several years of IT/OT and IIoT Administration, Communications Infrastructure Design and Project Management.

Currently the VP of Technology for Oil City Iron Works, Inc., in Corsicana, TX.

Subscribe for Updates:

This field is for validation purposes and should be left unchanged.
This field is hidden when viewing the form

Next Steps: Sync an Email Add-On

To get the most out of your form, we suggest that you sync this form with an email add-on. To learn more about your email add-on options, visit the following page (https://www.gravityforms.com/the-8-best-email-plugins-for-wordpress-in-2020/). Important: Delete this tip before you publish the form.
Name(Required)
Email(Required)