开发者

MySQL: Is there a way to reset a table?

开发者 https://www.devze.com 2023-01-05 11:20 出处:网络
Is there a way to reset a table开发者_如何学编程? I mean not only deleting all rows, but starting the auto_incrementing ID back to 0?To remove all data:

Is there a way to reset a table开发者_如何学编程?

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


To remove all data:

TRUNCATE TABLE tablename

To reset the auto-increment:

ALTER TABLE tablename AUTO_INCREMENT = 1
0

精彩评论

暂无评论...
验证码 换一张
取 消