You can execute the DROP DATABASE statement to delete a database.

Syntax

drop_database_stmt:
    DROP DATABASE [IF EXISTS] database_name;

Parameters

Parameter Description
IF EXISTS Executes the statement only when the specified database exists.
database_name Specifies the name of the database that you want to delete.

Examples

Delete the database named test.
mysql>drop database test;
Query OK, 0 rows affected (0.03 sec)

mysql>drop database if exists test;
Query OK, 0 rows affected, 1 warning (0.00 sec)