Home >Database >Mysql Tutorial >Statement to delete database in mysql
To delete a MySQL database, use the DROP DATABASE database_name; statement, where database_name is the name of the database to be deleted. Note: Back up data. Only users with DROP permissions can delete the database. Delete all objects in the database before deletion.
MySQL statement to delete the database
How to delete the MySQL database?
To delete a MySQL database, you can use the following command:
<code class="sql">DROP DATABASE database_name;</code>
where database_name
is the name of the database to be deleted.
Note:
DROP
permission can delete the database. Execution steps:
mysql -u username -p password
. DROP DATABASE database_name;
command. Y
. Example:
To delete the database named my_database
, you can execute the following command:
<code class="sql">DROP DATABASE my_database;</code>
The above is the detailed content of Statement to delete database in mysql. For more information, please follow other related articles on the PHP Chinese website!