【转载】Mysql删除所有表不删除数据库方法

删除表的命令

drop table 表名;
  • 1如果有200张表,执行200次,想想就不想动手了。

下面提供一个使用information_schema库的方案:

SELECT CONCAT('drop table ',table_name,';') FROM information_schema.`TABLES` WHERE table_schema='数据库名';

通过这条命令来得到drop table 表名;这样的语句,然后批量执行。

转载地址:http://blog.csdn.net/zenson_g/article/details/49205919

原文地址:https://www.cnblogs.com/linewman/p/9918279.html