DROP DATABASE
Complete guide to removing databases in MariaDB. Complete DROP DATABASE syntax with IF EXISTS, permissions, and recovery options for production use.
Syntax
DROP {DATABASE | SCHEMA} [IF EXISTS] db_nameDescription
IF EXISTS
Atomic DDL
LOOP OVER ALL tables
DROP TABLE tblExamples
DROP DATABASE bufg;
Query OK, 0 rows affected (0.39 sec)
DROP DATABASE bufg;
ERROR 1008 (HY000): Can't drop database 'bufg'; database doesn't exist
\W
SHOW warnings enabled.
DROP DATABASE IF EXISTS bufg;
Query OK, 0 rows affected, 1 warning (0.00 sec)
Note (Code 1008): Can't DROP DATABASE 'bufg'; DATABASE doesn't existSee Also
Last updated
Was this helpful?

