DROP DATABASE

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

Syntax

drop_database_stmt:
DROP DATABASE [IF EXISTS] database_name;

Parameters

Parameter Description
IF EXISTS This parameter is used to mitigate errors that occur when you delete a database that does not exist.
database_name The name of the database that you want to delete.

Examples

Use the following statements to delete a database that is named test:

drop database test;
Query OK, 0 rows affected (0.03 sec)

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

results matching ""

    No results matching ""