mysql truncate 数据库所有表

 

第一步:查询出所有要 truncate 的脚本

select CONCAT('truncate TABLE ',TABLE_NAME, ';') from
 INFORMATION_SCHEMA.TABLES where  table_schema in ('plan-template');

-- plan-template 是数据库名

 

第二步:把查询结果复制粘贴执行

 

posted @ 2020-12-11 10:28  秋香姑娘请你不要紧张  阅读(1022)  评论(0编辑  收藏  举报