Home >Database >Mysql Tutorial >What is the instruction to delete database in mysql
The command to delete a database in MySQL is DROP DATABASE, and its syntax is: DROP DATABASE database_name; When using it, please note that the database must be empty, and the deletion operation requires DROP permission.
MySQL delete database command
The command to delete a database in MySQL is DROP DATABASE
.
Syntax:
<code>DROP DATABASE database_name;</code>
Among them, database_name
is the name of the database to be deleted.
Usage:
DROP
authority). ;
) after the database name, because the DROP DATABASE
statement itself will automatically add a semicolon. Example:
To delete the database named my_database
, you can use the following command:
<code>DROP DATABASE my_database;</code>
Note:
DROP DATABASE
instruction, please make sure you have backed up or exported the data to be deleted. DROP DATABASE
operation will fail. DROP PROCEDURE
, DROP FUNCTION
or other corresponding instructions to delete them first. The above is the detailed content of What is the instruction to delete database in mysql. For more information, please follow other related articles on the PHP Chinese website!