You need to enable JavaScript to run this app.
导航
DescribeDatabases
最近更新时间:2024.11.05 16:00:06首次发布时间:2023.02.02 17:41:22

调用 DescribeDatabases 接口查看数据库列表。

请求类型

同步请求。

调试

请求参数

参数
类型
是否必选
示例值
描述
InstanceId
String
mysql-r3xq0zdl****
实例 ID。
DBName
String
testdb1
数据库名称。
PageNumber
Integer
1
当前页页码。取值最小为 1。默认值为 1。
PageSize
Integer
10
每页记录数。最小值为 1,最大值不超过 100。默认值为 10。

返回参数

参数
类型
示例值
描述
Total
Integer
1
数据库总数。
Databases
Object[]
[ { "CharacterSetName": "utf8", "DBDesc": "这是一段数据库 testdb1 的描述。", "DBName": "testdb1", "DBPartition": 0, "DBStatus": "Available", "DatabasePrivileges": null, "DatabasePrivilegesInfo": null } ]
数据库列表。

示例

请求示例

POST /?Action=DescribeDatabases&Version=2022-01-01 HTTP/1.1
Content-Type: application/json
Host: rds.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
    }
}

错误码

更多详情,请参见错误码