调用 GrantDBAccountPrivilege 接口为指定数据库账号赋予数据库权限。
同步请求。
参数 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
InstanceId | String | 是 | mysql-62e07c2c**** | 实例 ID。 |
AccountName | String | 是 | testuser | 账号名称。 |
Host | String | 否 | % | 账号访问数据库的 IP 地址。默认值为 % 。 |
AccountPrivileges | Object[] | 是 | [
{
"DBName":"db1",
"AccountPrivilege":"ReadWrite"
}
] | 重置账号授权信息。 |
null
POST /?Action=GrantDBAccountPrivilege&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-62e07c2c****", "AccountName": "test", "AccountPrivileges": [ { "DBName": "testdb", "AccountPrivilege": "DDLOnly", "AccountPrivilegeDetail": "" }, { "DBName": "testdb1", "AccountPrivilege": "ReadOnly", "AccountPrivilegeDetail": "" } ] }
{ "ResponseMetadata": { "RequestId": "20230116115015A96C208EE46C00F7D56B", "Action": "GrantDBAccountPrivilege", "Version": "2022-01-01", "Service": "rds_mysql", "Region": "cn-beijing" }, "Result": null }
更多详情,请参见错误码。