How to reset table auto incremented field value to zero MYSQL?

You might be a beginner or an expert developer. And you never needed to set your table auto incremented value back to zero until you do. Here is a short tutorial how you can do that and it is very easy.

You need to go phpmyadmin and select your database go to table that have a field with auto increment.

After selecting the table, you need to click operation tab from the top menu that you see on your screen.

See screenshot below

 

 

Once you are on operation screen scroll down to table options, you will see down there is a field called AUTO INCREMENT, you will see it will have some value, that value is going to be the next value auto incremented field. Change it and the new auto increment value will start from the value you will give in the field.

I am going to change it to “1”. And when I add the field in the table now it starts from 1.

 

 

It will reset the value of auto incremented so any next entries in the table and that field will start from the position you have set in the operation tab.

Note: In this example the “id” field was auto incremented. and I deleted the old rows and added them back again.