
使用 MySQL CLI,如何在不更改任何表結構的情況下刪除給定 MySQL 資料庫中的所有資料?
答案1
truncate
例子:
truncate table friends
– 將從表中刪除所有記錄並重建表,從而重置 auto_increment 計數器。
使用 MySQL CLI,如何在不更改任何表結構的情況下刪除給定 MySQL 資料庫中的所有資料?
truncate
例子:
truncate table friends
– 將從表中刪除所有記錄並重建表,從而重置 auto_increment 計數器。