How To reset MySQL Auto_Increament?

There are times when you are in a testing mode and have inserted and delted too many rows of data in one or too many tables
you may want to go to production mode and have finished all testing but the increamented value of AI of one or many tables have been upgraded to high numbers and things are a little untidy

don’t worry that there is a way for resetting a table Auto Increament value withouth having to delete and recreate the table or the column
to do so you only need to run this command in mysql console or PHPMyAdmin Console of that database

THank You

ALTER TABLE ‘TABLE_NAME’ AUTO_INCREMENT = 1;

Leave a Reply

Your email address will not be published. Required fields are marked *