MySQL: How to Change the Next Auto Increment Value in phpMyAdmin Tips, Tricks and Tutorials 12 FEB 2015

I needed a quick fix to an urgent problem the other day, and the best solution for that particular challenge turned out to be artificially manipulating tables’ ID primary keys in order to avoid clashes in a shared table when it came to foreign key entries. To do this I needed to set the ID keys of the different MySQL tables into different ranges, and to do that, I would need to manipulate or change the table’s auto_increment value to ensure that the next assigned ID value would be in my preferred range.

As it turns out, later versions of phpMyAdmin exposes this table property very nicely, making it particularly easy to change the auto increment value to whatever you want it to be.

To do this, select the table that you wish to make the change to. Once loaded, navigate to the Operations tab. The resulting screen will have a fieldset entitled Table options. If you look carefully, you’ll spot a field entitled AUTO_INCREMENT. This is the next auto incremented value the table will be using on the next row insert, and so this is the one you want to manipulate.

Change it to a valid entry for the currently applied to field type and hit ‘Go’ to save your change.

phpmyadmin operations change auto increment value

Literally as easy as that.

Related Link: http://www.phpmyadmin.net/home_page/index.php

Related Posts:

About Craig Lotter

Software developer, husband and dad to two little girls. Writer behind An Exploring South African. I don’t have time for myself any more.