For example, if you delete records with id's 7,8,9
Now when you insert through application, it inserts the new record starting at 10. But we want it to start at 7.
Use the following SQL to reset to a specific value
ALTER TABLE my_table AUTO_INCREMENT=7
If you want to delete all records from your table and restart auto-index at 1, then
TRUNCATE TABLE my_table
Thanks
ReplyDelete