批量删除某个数据库下所有表

1 SELECT concat('DROP TABLE IF EXISTS ', table_name, ';')
2 FROM information_schema.tables
3 WHERE table_schema = 'test_db';

step1:select出所有要删除表的删除语句,其中 test_db 是数据库下的模式名称, 
step2:执行step1输出的SQL语句即可

 

posted @ 2018-08-15 16:46  沃特啊又弄啥呢  阅读(1437)  评论(0编辑  收藏  举报