Clear, Reset ID Counter of MySQL Table #mysql #database #DZ4Team

Hosting and Websites

This is How to Reset ID Counter of MySQL Table :

1. copy this code:
– reset for new increment id only:

ALTER TABLE table_name AUTO_INCREMENT = 1;

– reset for all existing and new increment id:

SET @num := 0;

UPDATE your_table SET id = @num := (@num+1);

ALTER TABLE your_table AUTO_INCREMENT =1;

2. open your phpMyAdmin and go to SQL section.
3. past the code and replace “your_table” with  your table name.
4. click Go.

Sharing is caring!

DZ4Team

DZ4Team is a Web development team, We offer all types of scripts, installing, supporting and hosting. Contact Us: https://fb.com/DZ4TeamSupport

https://dz4team.com

Leave a Reply