MySQL drop database command

Deleting a database of MySQL

In the last chapter, we learned how to create a MySQL database. To drop a database in MySQL using MySQL command the syntax will be as follows.

Syntax to use Drop database

Following is the syntax of MySQL drop database:

Drop DATABASE test_db;

So in MySQL, Drop database keyword is followed by the database name to be deleted with a semi-colon “;”. Note that, this is case insensitive.

Ensure that, before running the drop database command you have sufficient privileges to delete a database or otherwise you will encounter an error.

Also, note that all tables and data in deleted database will be removed as well. So be careful as you plan to delete a database or take appropriate backup.

Also see MySQL create database

Was this article helpful?

Related Articles

Leave A Comment?