Create a database account for an AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes CreateAccount

The operation that you want to perform. Set the value to CreateAccount.

DBClusterId String Yes am-bp1r053byu48p****

The ID of the AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.

Note You can call the DescribeDBClusters operation to view cluster IDs.
AccountName String Yes test_accout

The name of the database account. The name must meet the following requirements:

  • The name starts with a lowercase letter and ends with a lowercase letter or a digit.
  • The name can contain lowercase letters, digits, and underscores (_).
  • The name is 2 to 16 characters in length.
  • Reserved account names such as root, admin, and opsadmin cannot be used.
AccountPassword String Yes Test_accout1

The password of the database account. The password must meet the following requirements:

  • The password contains at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters.
  • Special characters include ! @ # $ % ^ & * ( ) _ + - =
  • The password is 8 to 32 characters in length.
AccountDescription String No Test account

The description of the database account.

  • The description cannot start with http:// or https://.
  • The description can be up to 256 characters in length.
AccountType String No Normal

The type of the database account. Default value: Super. Valid values:

  • Normal: standard account. Up to 256 standard accounts can be created for a cluster.
  • Super: privileged account. Only a single privileged account can be created for a cluster.
Important If a cluster does not have accounts, you can specify this parameter to create a privileged account or standard account. If a cluster has a privileged account, you must set this parameter to Normal to create a standard account. Otherwise, the operation fails.

Response parameters

Parameter Type Example Description
TaskId Integer 1564657730

The ID of the task.

RequestId String 2FED790E-FB61-4721-8C1C-07C627FA5A19

The ID of the request.

DBClusterId String am-bp1r053byu48p****

The ID of the AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.

Examples

Sample requests

http(s)://adb.aliyuncs.com/?Action=CreateAccount
&DBClusterId=am-bp1r053byu48p****
&AccountName=test_accout
&AccountPassword=Test_accout1
&AccountDescription=Test account
&AccountType=Normal
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<CreateAccountResponse>
    <TaskId>1564657730</TaskId>
    <RequestId>2FED790E-FB61-4721-8C1C-07C627FA5A19</RequestId>
    <DBClusterId>am-bp1r053byu48p****</DBClusterId>
</CreateAccountResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "TaskId" : 1564657730,
  "RequestId" : "2FED790E-FB61-4721-8C1C-07C627FA5A19",
  "DBClusterId" : "am-bp1r053byu48p****"
}

Error codes

HTTP status code Error code Error message Description
404 InvalidDBCluster.NotFound The DBClusterId provided does not exist in our records. The error message returned because the specified value for the DBClusterId parameter does not exist. Check whether the value is valid.

For a list of error codes, visit the API Error Center.