If the table engine is InnoDB then it's enough to restart the MySQL service (if this is possible on your setup).
The InnoDB table engine doesn't store the auto-increment value anywhere. When the server starts, it finds the largest value present in the table (it's easy, the AUTO_INCREMENT column is always the table's PK), increments it and this is the new value it uses on the next INSERT.
It is explained in the documentation:
If you specify an AUTO_INCREMENT column for an InnoDB table, the table handle in the InnoDB data dictionary contains a special counter called the auto-increment counter that is used in assigning new values for the column. This counter is stored only in main memory, not on disk.
To initialize an auto-increment counter after a server restart, InnoDB executes the equivalent of the following statement on the first insert into a table containing an AUTO_INCREMENT column.
SELECT MAX(ai_col) FROM table_name FOR UPDATE;
InnoDB increments the value retrieved by the statement and assigns it to the column and to the auto-increment counter for the table. By default, the value is incremented by 1.
auto_incrementdoesn't correspond to number of rows and you are not supposed to reset it. Its job isn't to be sequential but unique. To do so,auto_incrementuses a simple algorithm that increments last number byauto_increment_offset- which gives it infinite unique values and works fast in concurrent environment. When something is deleted or an insert fails, the value is forever spent and is never reused. You have no problem unless you tamper withauto_increment.