All Products
Search
Document Center

ApsaraDB RDS:CreateAccount

Last Updated:Mar 13, 2024

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

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

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 instance ID.

rm-uf6wjk5xxxxxxx
AccountNamestringYes

The username of the account.

  • 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.

  • 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 account type. Valid values:

  • Normal: standard account (default).
  • Super: privileged account.
  • Sysadmin: system admin account. The account type is available only for ApsaraDB RDS for SQL Server instances.

Before you create a system admin account, check whether the RDS instance meets all prerequisites. For more information, see Create a system admin account.

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.
400Order.ComboInstanceNotAllowOperateA package instance is not allowed to operate independently.A package instance is not allowed to operate independently.
400Price.PricingPlanResultNotFoundPricing plan price result not found.Pricing plan price result not found.
400Order.NoRealNameAuthenticationYou have not passed the real-name authentication and do not meet the purchase conditions. Please log in to the user center for real-name authentication.You have not passed the real-name authentication and do not meet the purchase conditions. Please log in to the user center for real-name authentication.
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 code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    Error Codes 400 change
    Added Error Codes: 403
    Added Error Codes: 404
2022-06-23API Description Update. The Error code has changedsee changesets
Change itemChange content
API DescriptionAPI Description Update.
Error CodesThe Error code has changed.
    delete Error Codes: 400
2021-08-13The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    Error Codes 400 change