How to Reset AUTO_INCREMENT in MySQL?
There is a common issue which is usually faced by almost every newbie web developer or database administrator. When you insert records in your table of database after deleting all or some records from that table, if AUTO_INCREMENT property was set on your ID column or any other column, when you insert new records in that table it starts generating ID after the last ID generated by AUTO_INCREMENT in table, the following SQL query can reset the AUTO_INCREMENT from beginning or any number you want. 🙂
SQL Query
ALTER TABLE tablename AUTO_INCREMENT = 1
You can also reset it from the MySQL => Operations => Table Options. Just change AUTO_INCREMENT to 1.
Facebook Official Page: All PHP Tricks
Twitter Official Page: All PHP Tricks
Hi Mr. Javed,
recently I reached your web site. you are explained all in detail in a simple way.
my name is George Fernandez old developer since 1986. I would like to shift my platform from visual FoxPro to PHP, Mysql, HTML, CSS, Bootstrap, Jquery, Javascript, Ajax.
I have some doubt regards above mentioned languages. so can help to solve my doubts.
Please give me your email and WhatsApp.
I am waiting for your reply.
Very Nice tutorials brother, Thanks… Keep it up…
Do you have youtube videos please display links on the tutorial…
Thanks Rajendra, currently i am not making any videos.
But if i will make then i will surely share them.