# 删除表的命令
drop table 表名;
如果有200张表,执行200次,想想就不想动手了。
下面提供一个使用information_schema库的方案:
```mysql
SELECT GROUP_CONCAT(CONCAT('drop table ',table_name) separator ';') FROM information_schema.`TABLES` WHERE table_schema='db';
```
下面是实际操作
```mysql
MySQL [seahub-db]> SELECT GROUP_CONCAT(CONCAT('drop table ',table_name) separator ';') FROM information_schema.`TABLES` WHERE table_schema='seahub-db';
+-------------------------------------------------------------------------------------------------------------------------------------+
| GROUP_CONCAT(CONCAT('drop table ',table_name) separator ';') |
+-------------------------------------------------------------------------------------------------------------------------------------+
| drop table share_fileshare;drop table termsandconditions_termsandconditions;drop table two_factor_staticdevice;drop table wiki_wiki |
+-------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
###执行刚生成的drop语句
MySQL [seahub-db]> drop table share_fileshare;drop table termsandconditions_termsandconditions;drop table two_factor_staticdevice;drop table wiki_wiki;
Query OK, 0 rows affected (0.06 sec)
Query OK, 0 rows affected (0.06 sec)
Query OK, 0 rows affected (0.06 sec)
Query OK, 0 rows affected (0.08 sec)
MySQL [seahub-db]> show tables;
Empty set (0.00 sec)
```