Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to reset the auto incrementing value of a field so it starts back at 1 ?

| Field | Type             | Null | Key | Default | Extra          |
| id    | int(10) unsigned | NO   | PRI | NULL    | auto_increment | 
| name  | varchar(45)      | NO   |     | NULL    |                | 
share|improve this question
up vote 7 down vote accepted

To reset back to it's lowest possible value.


If you're doing it because you've deleted records with the view to resetting a table back to an empty state, then consider using TRUNCATE in the future, which will take care of the auto increment for you.

TRUNCATE <tablename>;
share|improve this answer


If the table is empty.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.