MySQL: Is there a way to reset tables?

Is there a way to reset tables?

I mean not only deleting all rows, but also starting the auto_incrementing identifier back to 0?

+4
source share
2 answers

To delete all data:

TRUNCATE TABLE tablename 

In reset auto increment:

 ALTER TABLE tablename AUTO_INCREMENT = 1 
+10
source

Source: https://habr.com/ru/post/1314341/


All Articles