mysql truncate数据库所有表

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

执行这条sql,产生的结果就是一大串的trucate表的sql,然后执行就好了,truncate表有风险,需谨慎

posted @ 2019-03-04 14:55  你就像甜甜的益达  阅读(188)  评论(0编辑  收藏  举报