Reputation: 57974
Is there a way to reset a table?
I mean not only deleting all rows, but starting the auto_incrementing ID back to 0?
Upvotes: 5
Views: 226
Reputation: 171421
To remove all data:
TRUNCATE TABLE tablename
To reset the auto-increment:
ALTER TABLE tablename AUTO_INCREMENT = 1
Upvotes: 11