Call the DescribeDatabases API to view the database list.
Synchronous request.
Name | Type | Required | Example | Description |
|---|---|---|---|---|
InstanceId | String | Yes | mysql-r3xq0zdl**** | Instance ID. |
DBName | String | No | testdb1 | Database name. |
PageNumber | Integer | No | 1 | Current page number. The minimum value is 1. Default value is 1. |
PageSize | Integer | No | 10 | Number of records per page. The minimum value is 1, and the maximum value cannot exceed 1000. Default value is 10. |
Name | Type | Example | Description |
|---|---|---|---|
Total | Integer | 1 | Total number of databases. |
Databases | Object[] | [
{
"CharacterSetName": "utf8",
"DBDesc": "This is a description of the database testdb1.",
"DBName": "testdb1",
"DBPartition": 0,
"DBStatus": "Available",
"DatabasePrivileges": null,
"DatabasePrivilegesInfo": null
}
] | Database list. |
DBName | String | db1 | Database name. |
CharacterSetName | String | utf8mb4 | Database character set. |
DBDesc | String | 这是一段数据库的描述信息。 | The description information of the database. If the database has no description information, this field is empty. |
DBStatus | String | Available | Database status. The possible values are:
|
DatabasePrivileges | Object[] | [
{
"AccountName": "user1",
"AccountPrivilege":"ReadWrite"
}
] | Database account permission list. |
AccountName | String | testdb1 | The name of the account that requires authorization. |
Host | String | % | The specified database account can access the IP address of the database. The default value is %.
|
AccountPrivilege | String | ReadWrite | The type of account permission granted, with the following values:
tip The permission type is single-choice. An error will be reported if multiple permissions are passed. |
AccountPrivilegeDetail | String | SELECT,INSERT,UPDATE | Database privilege string. When used as a request parameter, it is required when the value of AccountPrivilege is
When used as a return result, regardless of whether the value of AccountPrivilege is tip Multiple strings are separated by English commas (,). |
POST /?Action=DescribeDatabases&Version=2022-01-01 HTTP/1.1 Content-Type: application/json Host: rds-mysql.cn-beijing.volcengineapi.com X-Date: 20211202T101010Z Authorization: HMAC-SHA256 Credential=AKLTN2I0MmFiNzMxNWE5NDgzMzk4MmVjMTVkODlkZTZ****/20211202/cn-beijing/rds_mysql/request,SignedHeaders=x-date, Signature=71d31fc7bcf990142851c9833c5656391486cda0ae2e0b8ada733b7c6458**** { "InstanceId": "mysql-4674157d****", "PageSize": 10, "PageNumber": 1 }
{ "ResponseMetadata": { "RequestId": "2023011116092131FBB0733F03E98C9690", "Action": "DescribeDatabases", "Version": "2022-01-01", "Service": "rds_mysql", "Region": "cn-beijing" }, "Result": { "Databases": [ { "CharacterSetName": "utf8", "DBDesc": "这是一段数据库 testdb1 的描述。", "DBName": "testdb1", "DBPartition": 0, "DBStatus": "Available", "DatabasePrivileges": [ { "AccountName": "TestAccount1", "AccountPrivilege": "ReadOnly", "AccountPrivilegeDetail": "LOCK TABLES,SELECT,SHOW VIEW", "Host": "192.***.***.2" }, { "AccountName": "TestAccount2", "AccountPrivilege": "ReadWrite", "AccountPrivilegeDetail": "ALTER,ALTER ROUTINE,CREATE,CREATE ROUTINE,CREATE TMP TABLE,CREATE VIEW,DELETE,DROP,EVENT,EXECUTE,INDEX,INSERT,LOCK TABLES,REFERENCES,SELECT,SHOW VIEW,TRIGGER,UPDATE", "Host": "%" } ] }, { "CharacterSetName": "utf8", "DBDesc": "这是一段数据库 testdb2 的描述信息。", "DBName": "testdb2", "DBPartition": 0, "DBStatus": "Available", "DatabasePrivileges": [ { "AccountName": "TestAccount2", "AccountPrivilege": "ReadOnly", "AccountPrivilegeDetail": "LOCK TABLES,SELECT,SHOW VIEW", "Host": "%" } ] } ], "Total": 2 } }
For more details, refer to Error codes.