This topic describes how to drop a database in MySQL mode.
Drop a database by using an SQL statement
You can use the DROP DATABASE statement to drop a database from a MySQL tenant.
If the recycle bin feature is enabled, a database dropped by mistake can be restored from the recycle bin. For more information, see Recycle bin for databases, tables, and indexes.
Example:
obclient> DROP DATABASE my_db;
Drop a database in OCP
OceanBase Database has three built-in databases: oceanbase, information_schema, and mysql. These built-in databases cannot be dropped. You can drop custom databases from MySQL tenants in OceanBase Cloud Platform (OCP).
Before you drop a database, make sure that the password box of the current OCP user contains the root password of the tenant. Otherwise, the drop operation fails. To drop a database in OCP, perform the following steps:
Log on to the OCP console.
In the left-side navigation pane, click Tenants to go to the Tenants page.
In the tenant list, find the tenant of the database that you want to drop and click the tenant name to go to the Overview page.
In the left-side navigation pane, click Database Management. The Database Management page appears.
In the database list, find the database that you want to drop and click Delete in the Actions column.
In the dialog box that appears, enter delete to confirm the operation and click Delete.