How to reset Auto Increment back to 1 in XAMPP MySQL using phpMyAdmin

Once the system is up and running and you have done so many tests for your database entry the entries just kept on accumulating even when you deleted every records from the table, that has an AUTO Increment ID field, the delete option will not reset the Auto Increment.  There are two methods to reset the numbering:

Method 1:

The easiest way to reset the auto increment number is to use the query  truncate tablename which removes all the rows from that table and resets the auto increment back to 1.

Method 2:

If you want to do it visually, phpMyAdmin provides option for that:

auto increment 1

  1. In phpMyAdmin, open the table for which you want to reset the auto increment number.
  2. on the menu, Operations Table Options
  3. on the AUTO_INCREMENT field, reset the number to whichever value you want,  then save ► GO the changes.

When you insert new record the auto increment number will start the number you set at the AUTO_INCREMENT field, in this illustration it is at number 11.

Leave a comment