Articles

Easily Set Auto Increment In phpMyAdmin To Any Value Of Your Choice

So you wish to manually set auto increment in phpMyAdmin? If yes, this article will show you how to do it very easily. In fact, I am going to share two way of setting auto increment. One way would be to start the count from the number “1” and the other would be to start the count from any number you desire, such as “250” or “5001” or “3689”. Exciting? Read on to find out how to do this.

How To Easily Set Auto Increment Value In phpMyAdmin

Lets take a look at both the cases.

1) Start auto increment from 1.

While adding a column, simply check the checkbox under “A_I” column. This A_I column stands for auto-increment. Just make sure that for the “Type” column against this entry, select any type that represents a numerical value such as Tinyint, Smallint, Mediumint, Int, Bigint, Double. See the screenshot below to understand it more clearly:

Set Auto Increment To 1 in phpMyAdmin

Set Auto Increment To 1 in phpMyAdmin

Once you create the table, just click on the “Structure” tab and check to see if “AUTO_INCREMENT” appears under the “Extra” column against this field. If yes, then congrats! You have successfully implemented case 1.

2) Start auto increment at any value of your choice.

This is simple too. You will just need to do couple of extra steps in addition to case 1. Once you have your table ready, just click on “Operations” tab. Look for “Table Options” fieldset.  In this, you will see “AUTO_INCREMENT” with a textbox against it. Now this is where you need to enter the new value that you desire. So if you want the table’s count to start from 5000 instead of 1, just enter 5000 in this textbox and click on the “Go” button. Here is a screenshot of how it can look:

Set Auto Increment in phpMyAdmin

Set Auto Increment in phpMyAdmin

 

You can enter any other positive number that you like instead of 5000. If you have done it correctly, you will see a success message saying:

“Your SQL query has been executed successfully”.

IMPORTANT NOTE:

There is one important note to remember. If you ever truncate the table, then the count will be restored to 1 automatically, even if you have allotted it a custom number. In such a case, make sure to repeat the steps mentioned in Case 2 above, should you ever truncate the table.

Simple, isn’t it?

Do you know of any other ways to manually set auto increment value in phpMyAdmin? Feel free to suggest by commenting below.

One Comment on Easily Set Auto Increment In phpMyAdmin To Any Value Of Your Choice

  1. 1

    Does not work

Share your thoughts, comment below now!

*

*