delete all record from table in mysql因為使用 safe update mode,所以無法使用
delete from tableName;
刪除資料表中的所有內容
方案一
delete from tableName limit 1000
you can replace 1000 by whatever the count of the table is (
select count(*) from tableName
)
方案二
truncate tableName
this wont work if there is FK and cascading enabled
方案三
暫時關掉safe update mode:
SET SQL_SAFE_UPDATES=0;