PolarDB-X instances support two types of accounts: privileged account and standard account. This topic describes how to manage database accounts.
Account types
The following table describes the types of database accounts that are supported by PolarDB-X instances.
Account type | Description |
Privileged account |
|
Standard account |
|
Note
- After an account is created, the type of the account cannot be changed. If you want to change the type of the account, delete the account and then use the same username of the account to create an account of the other type.
- You can create RAM users within your Alibaba Cloud account and grant the permissions on specific instances to the RAM users. For more information, see Create a RAM user.
The following sections describe the operations that you can perform on database accounts in the console.
Precautions
- You can create only one privileged account for each PolarDB-X instance.
- You cannot delete the privileged account after it is created.
Create an account
- Log on to the PolarDB for Xscale console.
- In the top navigation bar, select the region where the target instance is located.
- On the Instances page, click the PolarDB-X 2.0 tab.
- Find the target instance and click its ID.
- In the left-side navigation pane, choose .
- Click Create an account. In the panel that appears, configure the parameters.
Parameter Description Account name The username of the account. Note The username must meet the following requirements:- The username can be up to 16 characters in length and can contain lowercase letters, digits, and underscores (_).
- The username must start with a lowercase letter and end with a lowercase letter or a digit.
- The username must be unique and cannot be the same as the username of an existing account.
Account types The type of the account. You can specify the account to be a privileged account or standard account. Authorization database The databases that can be accessed by using the credential of the account. You can specify one or more databases. - Select one or more databases and click the icon to move the selected databases from the Unauthorized database section on the left side to the Authorized database section on the right side.
- In the Authorized database section, select the database permissions that you want to grant to the account.
Note- This parameter is available only when you create a standard account.
- This parameter is optional. You can grant permissions to the account after the account is created.
- Supported permissions: Read and Write, Read Only, DML Only, and DDL Only.
- If you want to grant the same permissions on all selected databases, click the permission name such as All Read and Write next to Authorized database.
Password The password of the account. Note The password must meet the following requirements:- The password must be 8 to 20 characters in length.
- The password must contain at least three types of the following characters: uppercase letters, lowercase letters, digits, and special characters.
- Special characters include @ # $ % ^ & + =
Confirm password Enter the same password to confirm the password. Descr Optional. The description of the account. The description can help you identify the account. The description can be up to 256 characters in length. - Click OK.
Reset the password of a database account
- Log on to the PolarDB for Xscale console.
- In the top navigation bar, select the region where the target instance is located.
- On the Instances page, click the PolarDB-X 2.0 tab.
- Find the target instance and click its ID.
- In the left-side navigation pane, choose .
- On the Account Management page, find the account for which you want to reset the password and click modifyPassword in the Operation column.
- In the dialog box that appears, enter and confirm the new password, and then click OK. Note The password must meet the following requirements:
- The password must be 8 to 20 characters in length.
- The password must contain at least three types of the following characters: uppercase letters, lowercase letters, digits, and special characters.
- Supported special characters: @#$%^&+=
Modify permissions for a standard account
- Log on to the PolarDB for Xscale console.
- In the top navigation bar, select the region where the target instance is located.
- On the Instances page, click the PolarDB-X 2.0 tab.
- Find the target instance and click its ID.
- In the left-side navigation pane, choose .
- On the Account Management page that appears, find the account for which you want to modify permissions and click Modify Permit in the Operation column. Note The privileged account of an instance is granted full permissions on all databases in the instance. You do not need to modify permissions for the privileged account.
- In the panel that appears, select one or more databases in the Unauthorized database section and click the icon to move the selected databases to the Authorized database section.
- In the Authorized database section, select the database permissions that you want to grant to the account. Note
- Supported permissions: Read and Write, Read Only, DML Only, and DDL Only.
- If you want to grant the same permissions on multiple selected databases, click the permission name such as All DDL Only next to Authorized database.
- Click OK.
Delete an account
Warning If you delete an account, clients that use the account fail to connect to the database. Proceed with caution.
- Log on to the PolarDB for Xscale console.
- In the top navigation bar, select the region where the target instance is located.
- On the Instances page, click the PolarDB-X 2.0 tab.
- Find the target instance and click its ID.
- In the left-side navigation pane, choose .
- On the Account Management page, find the account that you want to delete and click Delete in the Operation column.
- In the message that appears, click OK.