auto increment not starting from 1

12,753

Solution 1

If you really want to reset this, in phpMyAdmin, open this table, go to Operations and change the value for AUTO_INCREMENT.

Solution 2

ALTER TABLE tablename AUTO_INCREMENT = 1

This will reset your auto increment to start from 1

Solution 3

You can reset your auto increment ID from the following Command:

ALTER TABLE TABLE_NAME AUTO_INCREMENT = 1;

This will start from 1.

OR
go to LOCALHOST/PHPMYADMIN enter:

select your DB

after choose the specific table than go to Operations an set a number to the Auto increment.

Share:
12,753
Lmxc
Author by

Lmxc

Updated on June 04, 2022

Comments

  • Lmxc
    Lmxc over 1 year

    I am inserting some data to a database and I have an id column which has auto increment. I updated my xampp server yesterday and now the auto increment is starting from 4, 3, 5 in different tables. It used to work fine before. I did not delete any rows from the table it just starts from those numbers. What is wrong?

  • Sahnosh Rahguzar
    Sahnosh Rahguzar over 7 years
    Also use this: DELETE FROM table; ALTER TABLE table AUTO_INCREMENT = 1;
  • Marc Delisle
    Marc Delisle almost 5 years
    Please give more details: table's structure, MySQL version.
  • proofzy
    proofzy almost 5 years
    wow I'm in touch with phpmyadmin creator :D It's doesn't metter anyway