Queries the details of a database.


OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. You can use OpenAPI Explorer to search for API operations, call API operations, and dynamically generate SDK sample code.

Request parameters

Parameter Type Required Example Description
Action String Yes GetDatabase

The operation that you want to perform. Set the value to GetDatabase.

Host String Yes xxx.xxx.xxx.xxx

The connection address of the instance.

Port Integer Yes 3306

The port number that is used to connect to the instance.

SchemaName String Yes test_db

The name of the database.

Tid Long Yes -1

The ID of the tenant.

Note The tenant ID is taken from the tenant ID displayed when you move the pointer on your profile picture. For more information, see View tenant information .
Sid String No test_sid

The system ID (Sid) of the instance.

Response parameters

Parameter Type Sample response Description
Database Struct

The detailed information of the database.

CatalogName String def


DatabaseId String 1

The ID of the database.

DbType String mysql

The type of the database instance.

DbaId String 1

dba id

DbaName String dba_name

The nickname of the DBA.

Encoding String utf8mb4

The encoding format of the database.

EnvType String test

The type of the environment to which the database belongs.

Host String xxx.xxx.xxx.xxx

The endpoint of the database instance.

InstanceId String 1

The ID of the database instance.

OwnerIdList List 1

The ID of a database owner.

OwnerNameList List test

The nickname of a database owner.

Port Integer 3306

The connection port of the database instance.

SchemaName String test_db

The name of the database.

SearchName String test_db@xxx.xxx.xxx.xxx:3306

The query name of the database.

Sid String test_sid

The SID of the database instance.

State String NORMAL

The status of the database. For more information about the valid values, see the description of the ListDatabases operation.

ErrorCode String UnknownError

The error codes.

ErrorMessage String UnknownError

The error message of the failure.

RequestId String 3CDB8601-AD74-4A47-8114-08E08CD6319D

The ID of the request.

Success Boolean true

Indicates whether the request is successful.


Sample request

     http(s)://[Endpoint]/? Action=GetDatabase &Host=xxx.xxx.xxx.xxx &Port=3306 &SchemaName=test_db &Tid=-1 &<common request parameters> 

Sample success responses

XML format

     <Database> <Encoding> utf8mb4 </Encoding> <Host> pc-xxx.rwlb.rds.aliyuncs.com </Host> <InstanceId> 24710 </InstanceId> <DbType> polardb </DbType> <OwnerIdList> <OwnerIds> 88653 </OwnerIds> <OwnerIds> 104442 </OwnerIds> </OwnerIdList> <EnvType> product </EnvType> <DbaId> 104442 </DbaId> <OwnerNameList> <OwnerNames> xxx </OwnerNames> <OwnerNames> xxx [account] </OwnerNames> </OwnerNameList> <Port> 3306 </Port> <DatabaseId> 116367 </DatabaseId> <State> NORMAL </State> <SearchName> xxx_test@pc-xxx.rwlb.rds.aliyuncs.com:3306[xxx_test] </SearchName> <DbaName> xxx [sub-account] </DbaName> <SchemaName> xxx_test </SchemaName> </Database> <RequestId> returns </RequestId> <Success> true </Success> 


     {"Database": { "Encoding": "utf8mb4", "Host": "pc-xxx.rwlb.rds.aliyuncs.com", "InstanceId": 24710, "DbType": "polardb", "OwnerIdList": { "OwnerIds": [ 88653, 104442 ] }, "EnvType": "product", "DbaId": 104442, "OwnerNameList": { "OwnerNames": ["xxx", "xxx [Ram user]" ] }, "Port": 3306, "DatabaseId": 116377, "State": "NORMAL", "SearchName": "xxx_test@pc-xxx.rwlb.rds.aliyuncs.com:3306 [xxx_test]", "DbaName": "xxx [Ram user]", "SchemaName": "xxx_test" }, "RequestId": "Success", "Success": true} 

Error codes

For more information about error codes, see error center.