Search code examples
mysqlsqlphpmyadminauto-increment

How to reset auto increment column of a table in MySQL


I have a table and it's first column sl is auto incrementing. After populating my table, I removed first two rows, and the first entry is having sl 1. Is it possible to reset it to 1 maintaining AI? I am using PHP MyAdmin.


Solution

  • I'm not sure if i got your question but if you want your column sl to be renumbered do ALTER TABLE your_table DROP sl and then ALTER TABLE your_table ADD sl your_definitions