:: DEVELOPER ZONE
DROP {DATABASE | SCHEMA} [IF EXISTS] db_name
DROP DATABASE drops all tables in the database
and deletes the database. Be very careful with
this statement! To use DROP DATABASE, you need
the DROP privilege on the database.
In MySQL 3.22 or later, you can use the keywords IF
EXISTS to prevent an error from occurring if the database
doesn't exist.
DROP SCHEMA can be used as of MySQL 5.0.2.
If you use DROP DATABASE on a symbolically linked
database, both the link and the original database are deleted.
As of MySQL 4.1.2, DROP DATABASE returns the
number of tables that were removed. This corresponds to the number
of .frm files removed.
The DROP DATABASE statement removes from the
given database directory those files and directories that MySQL
itself may create during normal operation:
All files with these extensions:
.BAK
|
.DAT
|
.HSH
|
.ISD
|
.ISM
|
.ISM
|
.MRG
|
.MYD
|
.MYI
|
.db
|
.frm
|
All subdirectories with names that consist of two hex digits
00-ff. These are
subdirectories used for RAID tables. (These
directories are not removed as of MySQL 5.0, when support for
RAID tables was removed. You should convert your
RAID tables and remove these directories
manually before upgrading to MySQL 5.0. See
Section 2.10.1, “Upgrading from Version 4.1 to 5.0”.)
The db.opt file, if it exists.
If other files or directories remain in the database directory after
MySQL removes those just listed, the database directory cannot be
removed. In this case, you must remove any remaining files or
directories manually and issue the DROP DATABASE
statement again.
You can also drop databases with mysqladmin. See Section 8.4, “mysqladmin, Administering a MySQL Server”.
© 1995-2005 MySQL AB. All rights reserved.

User Comments
Warning: query failed: Unknown column 'user.firstname' in 'field list' in /data0/sites/live/web-main/lib/mysql-cxn.php on line 69
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /data0/sites/live/web-main/lib/docbook.php on line 245
Add your own comment.