Creates a database account.
Operation Description
debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
rds:CreateAccount | WRITE |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
DBInstanceId | string | Yes | The instance ID. You can call the DescribeDBInstances operation to query the ID of the instance. | rm-uf6wjk5xxxxxxx |
AccountName | string | Yes | The username of the account. Note
| test1 |
AccountPassword | string | Yes | The password of the account. Note
| Test123456 |
AccountDescription | string | No | The description of the account. The value must be 2 to 256 characters in length. The value can contain letters, digits, underscores (_), and hyphens (-), and must start with a letter. Note
: The name cannot start with http:// or https://.
| Test Account A |
AccountType | string | No | The type of the account. Valid values:
Default value: Normal. | Normal |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "D4D4BE8A-DD46-440A-BFCD-EE31DA81C9DD"
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | GeneralIns.Creating | The general instance is creating. | An RDS instance is in production. Please wait. |
400 | GeneralIns.Maintaining | The general instance is maintaining. | An RDS instance is being migrated or maintained. Please wait. |
400 | GeneralIns.Switching | The general instance is Switching. | A switchover for high availability is in progress. Please wait. |
400 | InvalidEngineVersion.NotSupported | Current db instance does not support sysadmin. | The operation failed. A sysAdmin account cannot be created on the RDS instance. |
400 | Database.ConnectError | Database connect error. please check instance status and database processlist | A database connection error occurred. Check the instance state and the database connection pool. |
400 | Account.AddError | Create Account failed, please check your input value or may your input value not satisfy instance current policy | Failed to create the account. Check the specified parameters or the parameter policy configuration. |
400 | InvalidAccountPassword.Format | Specified account password is not valid. | The password of the account is invalid. Specify a valid password. |
400 | InvalidAccountDescription.Format | Specified account description is not valid. | The account description is invalid. Specify a valid description. The description can be up to 256 characters in length and cannot be left unspecified. |
400 | InvalidGeneralGroupNameOrGdnInstanceName | The specified params generalGroupName or gdnInstanceName should not be null. | - |
400 | InvalidAccountPrivilege.Malformed | Specified account privilege is not valid. | Your account does not have the required permissions. |
400 | InvalidAccountName.Forbid | Specified account name is a keyword in RDS. | The username is invalid. Forbidden keywords cannot be used for a username. Modify the username. |
400 | InvalidAccountName.Duplicate | Specified account name already exists in this instance. | The username already exists in the RDS instance. Specify a different username. |
400 | InvalidDBDescription.Format | Specified DB description is not valid. | The database description is invalid. Specify a valid description. |
403 | IncorrectDBInstanceState | Current DB instance state does not support this operation. | - |
403 | IncorrectAccountType | Current account type does not support this operation. | This operation is not supported for the current account type. Check the account type. |
403 | AccountLimitExceeded | AccountQuotaExceeded: Exceeding the allowed amount of account | The number of accounts exceeds the maximum number of accounts that are allowed. |
404 | InvalidDBInstanceName.NotFound | The database instance does not exist. | The name of the RDS instance cannot be found. Check the name of the RDS instance. |
404 | IncorrectDBInstanceLockMode | Current DB instance lock mode does not support this operation. | The operation failed. The RDS instance is locked. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
2022-10-28 | The error codes of the API operation change. | see changesets | ||||||||
| ||||||||||
2022-06-23 | API Description Update,The error codes of the API operation change. | see changesets | ||||||||
| ||||||||||
2021-08-13 | The error codes of the API operation change. | see changesets | ||||||||
|