This topic describes how to drop a database in the MySQL mode of OceanBase Database by using an SQL statement.
Prerequisites
You have the DROP privilege. For information about how to view the privileges of the current user, see View user privileges. If you do not have the DROP privilege, contact the administrator. For information about how to grant privileges to a user, see Modify user privileges.
Procedure
Log on to a MySQL tenant of the cluster.
Use the
DROP DATABASEstatement to drop a database.Here is an example:
obclient> DROP DATABASE my_db;
What to do next
If the recycle bin feature is enabled, a database dropped by mistake can be restored from the recycle bin. For more information, see Restore objects from the recycle bin.
References
For more information about the syntax of the DROP DATABASE statement, see DROP DATABASE.