Grants an account the permissions on a database of an ApsaraDB for RDS instance.
Each account can be granted permissions on one or more databases. Before you call this operation, make sure that the instance is in the Running state.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | GrantAccountPrivilege |
The operation that you want to perform. Set the value to GrantAccountPrivilege. |
AccountName | String | Yes | test1 |
The name of the account. |
AccountPrivilege | String | Yes | ReadWrite |
The permissions that you want to grant to the account. Valid values:
Note
|
DBInstanceId | String | Yes | rm-uf6wjk5xxxxxxxxxx |
The ID of the instance. |
DBName | String | Yes | testDB |
The name of the database on which you want to grant permissions. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | 81BC9559-7B22-4B7F-B705-5F56DEECDEA7 |
The ID of the request. |
Examples
Sample requests
http(s)://rds.aliyuncs.com/? Action=GrantAccountPrivilege
&DBInstanceId=rm-uf6wjk5xxxxxxx
&AccountName=test1
&DBName=test
&AccountPrivilege=ReadWrite
&<Common request parameters>
Sample success responses
XML
format
<GrantAccountPrivilegeResponse>
<RequestId>81BC9559-7B22-4B7F-B705-5F56DEECDEA7</RequestId>
</GrantAccountPrivilegeResponse>
JSON
format
{
"RequestId":"81BC9559-7B22-4B7F-B705-5F56DEECDEA7"
}
Error codes
For a list of error codes, visit the API Error Center.