--- slug: /delete-database-of-api --- # delete_database - Delete a database The `delete_database()` method is used to delete a database. :::info This method is only available when using the `AdminClient`. For more information about the `AdminClient`, see [Admin Client](../100.admin-client.md). ::: ## Prerequisites * You have installed pyseekdb. For more information about how to install pyseekdb, see [Quick Start](../../10.pyseekdb-sdk/10.pyseekdb-sdk-get-started.md). * You have connected to the database. For more information about how to connect to the database, see [Admin Client](../100.admin-client.md). * If you are using server mode of seekdb or OceanBase Database, ensure that the user has the `DROP` privilege. For more information about how to view the privileges of the current user, see [View User Privileges](https://www.oceanbase.com/docs/common-oceanbase-database-cn-1000000003980135). If the user does not have the privilege, contact the administrator to grant the privilege. For more information about how to directly grant privileges, see [Directly Grant Privileges](https://www.oceanbase.com/docs/common-oceanbase-database-cn-1000000003980140). ## Request parameters ```python delete_database(name,tenant=DEFAULT_TENANT) ``` |Parameter|Type|Required|Description|Example Value| |---|---|---|---|---| |`name`|string|Yes|The name of the database to be deleted. |my_database| |`tenant`|string|No|The tenant to which the database belongs. |test_tenant| ## Request example ```python import pyseekdb # Embedded mode admin = pyseekdb.AdminClient(path="./seekdb") # Delete database admin.delete_database("my_database") ``` ## Response parameters None ## References * [Create a database](200.create-database-of-api.md) * [Get a specific database](300.get-database-of-api.md) * [Obtain a database list](400.list-database-of-api.md)