MySQL How to drop a database in MySQL

In order to drop a database in MySQL, you have to use the DROP DATABASE statement followed by the name of the database you want to drop. For example, if you want to drop a database named my_db, you will have to run the following SQL statement:
DROP DATABASE my_db;

If the database you want to drop does not exist, MySQL will throw an error. If you don't want an error, make sure the database is dropped only if it exists:
DROP DATABASE IF EXISTS my_db; 

Looking for a backup solution? Try Weap.io

Simple & flexible backup solution to keep your servers, websites & databases safe.

Start free trial
App screenshot