刪除表
drop table 表名
或者
drop table if exists 表名
delete語句
delete from 表名 where id = 1
用了delete語句刪除的數(shù)據(jù)是可以恢復(fù)的,通過二進(jìn)制日志恢復(fù).
truncate語句
truncate table 表名
清空表數(shù)據(jù),此語句刪除記錄后不可恢復(fù),但是刪除數(shù)據(jù)的速度比delete語句快,執(zhí)行該語句后相當(dāng)于一張新表,自增長的計(jì)數(shù)都會被重置為1