You can call the CreateAccount operation to create an account that is used to manage databases on an ApsaraDB RDS instance.
Before you call this operation, make sure that the following requirements are met:
- The instance must be in the Running state.
- The databases must be in the Running state.
- The number of accounts that are created on the instance cannot exceed the maximum number of accounts that are allowed for each instance. For the maximum number of accounts, see ~~41872~~
- This operation is supported only for instances that run MySQL, MariaDB TX, PostgreSQL, or SQL Server. This operation is not supported for instances that run SQL Server 2017 EE or SQL Server 2019 EE.
- You can create multiple privileged accounts and multiple standard accounts for each RDS instance that runs PostgreSQL with standard SSDs or enhanced SSDs (ESSDs).
- You can create only one privileged account for each RDS instance that runs PostgreSQL 9.4 or PostgreSQL 10.0 with local SSDs.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | CreateAccount |
The operation that you want to perform. Set the value to CreateAccount. |
AccountName | String | Yes | test1 |
The username of the account. Note
|
AccountPassword | String | Yes | Test123456 |
The password of the account. Note
|
DBInstanceId | String | Yes | rm-uf6wjk5xxxxxxx |
The ID of the instance. You can call the DescribeDBInstances operation to query the IDs of instances. |
AccountDescription | String | No | Test Account A |
The description of the account. The description must be 2 to 256 characters in length. The description can contain letters, digits, underscores (_), and hyphens (-). The description must start with a letter. Note The description cannot start with http:// or https://.
|
AccountType | String | No | Normal |
The type of the account. Valid values:
Default value: Normal. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | D4D4BE8A-DD46-440A-BFCD-EE31DA81C9DD |
The ID of the request. |
Examples
Sample requests
http(s)://rds.aliyuncs.com/?Action=CreateAccount
&DBInstanceId=rm-uf6wjk5xxxxxxx
&AccountName=test1
&AccountPassword=Test123456
&<Common request parameters>
Sample success responses
XML
format
<CreateAccountResponse>
<RequestId>D4D4BE8A-DD46-440A-BFCD-EE31DA81C9DD</RequestId>
</CreateAccountResponse>
JSON
format
{
"RequestId":"D4D4BE8A-DD46-440A-BFCD-EE31DA81C9DD"
}
Error codes
For a list of error codes, visit the API Error Center.