mysql ID auto increment doesn't starts from 0
auto-increment, database, mysql
Solution
You may either truncate the table using
TRUNCATE `table`
Truncate will delete all of the data in the table. Note that using `TRUNCATE` will also not fire any DELETE triggers like `DELETE`.
Or you can reset the count using
ALTER TABLE `table` AUTO_INCREMENT = 1
It is however the expected behavior. Don't do the latter unless the table is truly empty.
Problem
i have a table with ID , this ID is auto increment and primary key ,the first time i inserted to that table , the ID starts from 0 , but after i removing all the values from that table and inserted again to it , the ID doesn't start from 0 , but starts from the last value that ID had , what is going wrong please ? can i reset the value to 0 ?