How to drop a database with MySQLHow 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.

dropping a database with phpmyadmin

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

confirmation before dropping a phpmyadmin database

Click "OK" and the database will be dropped.

Related posts:

Comments

blog comments powered by Disqus