1. 程式人生 > 資料庫 >MYSQL:清空表中的資料

MYSQL:清空表中的資料

方法1:
delete from 表名;
方法2:
truncate table 表名;

比 較:效率上truncate比delete快,但truncate刪除後不記錄mysql日誌,不可以恢復資料。