May 2005
Intermediate to advanced
352 pages
14h 39m
English
DROP DATABASE
DROP DATABASE [IF EXISTS] databaseUse this
statement to delete a given database along with all its tables and
data. The addition of the IF EXISTS flag
suppresses an error message if the database does not already exist:
DROP DATABASE IF EXISTS test; Query OK, 6 rows affected (0.42 sec)
Notice that the number of tables deleted is returned in the rows affected count. If the database doesn't exist or if there are other files in the database's filesystem directory, an error message will be displayed. The tables will be deleted if other files exist, but the foreign file and the directory won't be removed. They will have to be deleted manually at the command line using a filesystem command such as rm in Unix or del in Windows.
Read now
Unlock full access