Dropping a Database


Use the DROP DATABASE command to drop a database completely. Use this command with extreme cautionyou cannot recover a dropped database unless you have a backup.

Dropping Databases

A user must have the DROP privilege in order to drop a database. Grant this privilege sparingly.


To drop the greekdb database, issue the following command:

 mysql> DROP DATABASE greekdb; Query OK, 0 rows affected (0.00 sec) 


Similar to CREATE DATABASE IF NOT EXISTS, you can use DROP DATABASE IF EXISTS to suppress an error if you try to drop a nonexistent database.




Sams Teach Yourself MySQL in 10 Minutes
Sams Teach Yourself MySQL in 10 Minutes
ISBN: 0672328631
EAN: 2147483647
Year: 2006
Pages: 165
Authors: Chris Newman

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net