一、删除指定的数据库
DROP {DATABASE()|SCHEMA()} db_name;
mysql> DROP DATABASE learndb2;
Query OK, 0 rows affected (0.12 sec)
Query OK, 0 rows affected (0.12 sec)
二、如果数据库存在是才删除数据库
DROP {DATABASE()|SCHEMA()} [IF EXISTS] db_name;
mysql> DROP DATABASE IF EXISTS learndb2;
Query OK, 0 rows affected, 1 warning (0.00 sec)
Query OK, 0 rows affected, 1 warning (0.00 sec)