top of page
MySQL:
DROP DATABASE
Syntax:
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. DROP SCHEMA is a synonym
for DROP DATABASE.
*Important*:
When a database is dropped, privileges granted specifically for the
database are not automatically dropped. They must be dropped manually.
See [HELP GRANT].
IF EXISTS is used to prevent an error from occurring if the database
does not exist.
URL: https://dev.mysql.com/doc/refman/8.0/en/drop-database.html
Example
bottom of page