IF EXISTS  is used to prevent an error from occurring if the database does not exist. 

If the default database is dropped, the default database is unset (the DATABASE()  function returns NULL ). 

If you use DROP DATABASE  on a symbolically linked database, both the link and the original database are deleted. 

DROP DATABASE  returns the number of tables that were removed. 

The DROP DATABASE  statement removes from the given database directory those files and directories that MySQL itself may create during normal operation. This includes all files with the extensions shown in the following list: 

• .BAK 

• .DAT 

• .HSH 

• .MRG 

• .MYD 

• .MYI 

• .cfg 

• .db 

• .ibd 

• .ndb 

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. 

Dropping a database does not remove any TEMPORARY  tables that were created in that database. TEMPORARY  tables are automatically removed when the session that created them ends. See Section 13.1.20.2, “CREATE TEMPORARY TABLE Statement” . 

You can also drop databases with mysqladmin . See Section 4.5.2, “mysqladmin — A MySQL Server Administration Program” . 

## 13.1.25 DROP EVENT Statement 

DROP EVENT [IF EXISTS] event_name 

This statement drops the event named event_name . The event immediately ceases being active, and is deleted completely from the server. 

If the event does not exist, the error ERROR 1517 (HY000): Unknown event ’ event_name ’  results. You can override this and cause the statement to generate a warning for nonexistent events instead using IF EXISTS . 

This statement requires the EVENT  privilege for the schema to which the event to be dropped belongs. 

## 13.1.26 DROP FUNCTION Statement 

The DROP FUNCTION  statement is used to drop stored functions and loadable functions: 

