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 your privileges, see View user privileges. If you do not have the DROP privilege, contact the administrator to obtain the privilege. For more information, see Grant direct privileges.
Procedure
Log in 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.