How to reset AUTO_INCREMENT in MySQL?

You can set the auto_increment value back to 1:

ALTER TABLE table_name AUTO_INCREMENT = 1

You might also want to TRUNCATE the table, it resets the AUTO_INCREMENT to 1

TRUNCATE TABLE table_name;

Need a good GUI Tool for MySQL? TablePlus is a modern, native tool with an elegant UI that allows you to simultaneously manage multiple databases such as MySQL, PostgreSQL, SQLite, Microsoft SQL Server and more.


Download TablePlus for Mac.

Not on Mac? Download TablePlus for Windows.

On Linux? Download TablePlus for Linux

Need a quick edit on the go? Download TablePlus for iOS.

TablePlus GUI Tool MySQL