You can call this operation to delete a database under an instance.

This operation must meet the following requirements:

  • The instance is in the running state.
  • The instance is a master instance.
  • The database engine is MySQL, SQL Server, or MariaDB.
Note This operation is not applicable to ApsaraDB RDS for PostgreSQL or PPAS. You can run the DROP DATABASE SQL statement to delete databases.

Debugging

You can use OpenAPI Explorer to perform debugging. OpenAPI Explorer allows you to perform various operations to simplify API usage. For example, you can retrieve APIs, call APIs, and dynamically generate SDK example code.

Request parameters

Parameter Type Required Example Description
Action String Yes DeleteDatabase

The operation that you want to perform. Set this parameter to DeleteDatabase.

DBInstanceId String Yes rm-uf6wjk5xxxxxxx

The ID of the instance.

DBName String Yes testdb01

The name of the database.

Response parameters

Parameter Type Example Description
RequestId String 07F6177E-6DE4-408A-BB4F-0723301340F3

The ID of the request.

Examples

Sample requests


http(s)://rds.aliyuncs.com/? Action=DeleteDatabase
&DBInstanceId=rm-uf6wjk5xxxxxxx 
&DBName=testdb01
&<Common request parameters>

Successful response examples

XML format

<DeleteDatabaseResponse>
	  <RequestId>07F6177E-6DE4-408A-BB4F-0723301340F3</RequestId></DeleteDatabaseResponse>

JSON format

{
	"RequestId":"07F6177E-6DE4-408A-BB4F-0723301340F3"
}

Error codes

For a list of error codes, visit the API Error Center.