All Products
Search
Document Center

ApsaraDB RDS:CreateAccount

Last Updated:Sep 26, 2023

Creates a database account.

Operation Description

Supported database engines

  • RDS MySQL
  • RDS PostgreSQL
  • RDS SQL Server
  • RDS MariaDB

References

Note : Before you call this operation, read the following documentation and make sure that you fully understand the prerequisites and impacts of this operation.

debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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.
OperationAccess levelResource typeCondition keyAssociated operation
rds:CreateAccountWRITE
  • DBInstance
    acs:rds:{#regionId}:{#accountId}:dbinstance/{#dbinstanceId}
  • rds:ResourceTag
none

Request parameters

ParameterTypeRequiredDescriptionExample
DBInstanceIdstringYes

The instance ID. You can call the DescribeDBInstances operation to query the ID of the instance.

rm-uf6wjk5xxxxxxx
AccountNamestringYes

The username of the account.

Note
  • The value must be unique.

  • The value must start with a lowercase letter, and end with a lowercase letter or a digit.

  • The value can contain lowercase letters, digits, and underscores (_).

  • The length of the value must meet the following requirements:

    • If the instance runs MySQL 5.7 or MySQL 8.0, the value must be 2 to 32 characters in length.
    • If the instance runs MySQL 5.6, the value must be 2 to 16 characters in length.
    • If the instance runs SQL Server, the value must be 2 to 64 characters in length.
    • If the instance runs PostgreSQL with cloud disks, the value must be 2 to 63 characters in length.
    • If the instance runs PostgreSQL with local disks, the value must be 2 to 16 characters in length.
    • If the instance runs MariaDB, the value must be 2 to 16 characters in length.
  • For more information about invalid characters, see Forbidden keywords table.

test1
AccountPasswordstringYes

The password of the account.

Note
  • The value must be 8 to 32 characters in length.

  • The password must contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters.

  • Special characters include ! @ # $ % ^ & * ( ) _ + - =

Test123456
AccountDescriptionstringNo

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
AccountTypestringNo

The type of the account. Valid values:

  • Normal: standard account
  • Super: privileged account

Default value: Normal.

Normal

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

RequestIdstring

The ID of the request.

D4D4BE8A-DD46-440A-BFCD-EE31DA81C9DD

Examples

Sample success responses

JSONformat

{
  "RequestId": "D4D4BE8A-DD46-440A-BFCD-EE31DA81C9DD"
}

Error codes

HTTP status codeError codeError messageDescription
400GeneralIns.CreatingThe general instance is creating.An RDS instance is in production. Please wait.
400GeneralIns.MaintainingThe general instance is maintaining.An RDS instance is being migrated or maintained. Please wait.
400GeneralIns.SwitchingThe general instance is Switching.A switchover for high availability is in progress. Please wait.
400InvalidEngineVersion.NotSupportedCurrent db instance does not support sysadmin.The operation failed. A sysAdmin account cannot be created on the RDS instance.
400Database.ConnectErrorDatabase connect error. please check instance status and database processlistA database connection error occurred. Check the instance state and the database connection pool.
400Account.AddErrorCreate Account failed, please check your input value or may your input value not satisfy instance current policyFailed to create the account. Check the specified parameters or the parameter policy configuration.
400InvalidAccountPassword.FormatSpecified account password is not valid.The password of the account is invalid. Specify a valid password.
400InvalidAccountDescription.FormatSpecified 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.
400InvalidGeneralGroupNameOrGdnInstanceNameThe specified params generalGroupName or gdnInstanceName should not be null.-
400InvalidAccountPrivilege.MalformedSpecified account privilege is not valid.Your account does not have the required permissions.
400InvalidAccountName.ForbidSpecified account name is a keyword in RDS.The username is invalid. Forbidden keywords cannot be used for a username. Modify the username.
400InvalidAccountName.DuplicateSpecified account name already exists in this instance.The username already exists in the RDS instance. Specify a different username.
400InvalidDBDescription.FormatSpecified DB description is not valid.The database description is invalid. Specify a valid description.
403IncorrectDBInstanceStateCurrent DB instance state does not support this operation.-
403IncorrectAccountTypeCurrent account type does not support this operation.This operation is not supported for the current account type. Check the account type.
403AccountLimitExceededAccountQuotaExceeded: Exceeding the allowed amount of accountThe number of accounts exceeds the maximum number of accounts that are allowed.
404InvalidDBInstanceName.NotFoundThe database instance does not exist.The name of the RDS instance cannot be found. Check the name of the RDS instance.
404IncorrectDBInstanceLockModeCurrent 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 timeSummary of changesOperation
2022-10-28The error codes of the API operation change.see changesets
Change itemChange content
Error CodesThe error codes of the API operation change.
    Error Codes 400 change
    Added Error Codes: 403
    Added Error Codes: 404
2022-06-23API Description Update,The error codes of the API operation change.see changesets
Change itemChange content
API DescriptionAPI Description Update
Error CodesThe error codes of the API operation change.
    delete Error Codes: 400
2021-08-13The error codes of the API operation change.see changesets
Change itemChange content
Error CodesThe error codes of the API operation change.
    Error Codes 400 change