Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

auto increment not starting from 1

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?

like image 661
Lmxc Avatar asked Oct 19 '13 01:10

Lmxc


1 Answers

ALTER TABLE tablename AUTO_INCREMENT = 1

This will reset your auto increment to start from 1

like image 189
Sobin Augustine Avatar answered Sep 28 '22 08:09

Sobin Augustine