How to drop a database with MySQL
Posted September 9th, 2009 in MySql
This post shows the SQL query used to drop a database with MySQL and also a couple of screenshots showing the same process using phpMyAdmin.
SQL Query
If the database to be dropped is called "test", run the following query to delete the entire database. This is irrecoverable and there is no prompting to see if you really do want to drop the database.
DROP DATABASE test;
Using phpMyAdmin
If you have phpMyAdmin installed you can drop databases easily (a little too easy, in my opinion). Log into phpMyAdmin, select the database you wish to drop and click the "Drop" option as shown in the screenshot below.

If Javascript is enabled then you'll be prompted like so before the database is actually dropped:

Click "OK" and the database will be dropped.
Related posts:
- Drop multiple MySQL tables (Wednesday, September 23rd 2009)
- How to drop a table with MySQL (Wednesday, September 16th 2009)
- Copy a table in MySQL with CREATE TABLE LIKE (Saturday, February 14th 2009)
- Renaming a table in MySQL (Wednesday, July 2nd 2008)

Comments
blog comments powered by Disqus