调用 GrantDatabasePrivilege 接口为指定数据库添加授权数据库账号。
同步请求。
参数 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
InstanceId | String | 是 | mysql-r3xq0zdl**** | 实例ID。 |
DBName | String | 是 | testuser1 | 数据库名称。 |
DatabasePrivileges | Object[] | 是 | [
{
"AccountName":"testuser",
"Host": "192.***.***.2",
"AccountPrivilege":"ReadWrite"
}
] | 数据库账号权限列表。 |
null
POST /?Action=GrantDatabasePrivilege&Version=2022-01-01 HTTP/1.1 Accept: application/json 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-7582b02b****", "DBName": "testdb1", "DatabasePrivileges": [ { "AccountName": "testuser1", "Host": "192.***.***.2", "AccountPrivilege": "ReadWrite" } ] }
{ "ResponseMetadata": { "RequestId": "202301161533354BFF2A1927E50A101666", "Action": "GrantDatabasePrivilege", "Version": "2022-01-01", "Service": "rds_mysql", "Region": "cn-beijing" }, "Result": null }
更多详情,请参见错误码。