select CONCAT('truncate TABLE ',table_schema,'.',TABLE_NAME, ';') from INFORMATION_SCHEMA.TABLES where table_schema in ('dbname');
执行这条sql,产生的结果就是一大串的trucate表的sql,然后执行就好了,truncate表有风险,需谨慎