1、清空test库中表数据:
select concat('truncate table ',table_schema,'.',table_name,';') as '执行sql' from information_schema.TABLES where table_schema='test';
2、删除test库中所有表:
select concat('drop table ',table_schema,'.',table_name,';') as '执行sql' from information_schema.TABLES where table_schema='test';
执行相关sql即可。
更多推荐
清空数据库sql
发布评论