Create a database account
AnalyticDB for MySQL supports two types of database accounts: privileged accounts and standard accounts. A privileged account can manage all standard accounts and databases. To perform database operations with a standard account, you must manually create the standard account and then grant it permissions.
Database account types
AnalyticDB for MySQL supports privileged accounts and standard accounts. The following table describes the differences between the two account types.
|
Account type |
Description |
|
privileged account |
|
|
standard account |
|
Create a privileged account
-
Log on to the AnalyticDB for MySQL console. In the upper-left corner of the console, select a region. In the left-side navigation pane, click Clusters. Find the cluster that you want to manage and click the cluster ID.
-
In the left-side navigation pane, click Accounts.
-
Create a privileged account.
-
For Enterprise Edition, Basic Edition, and Data Lakehouse Edition clusters: Click Create Account. In the Create Account panel, configure the parameters.
-
For Data Warehouse Edition clusters: Click Create Privileged Account. In the Create Privileged Account panel, configure the parameters.
Parameter
Description
Database Account
The name of the privileged account. The name must meet the requirements shown in the console.
Account Type
-
For a Data Warehouse Edition cluster, this parameter is fixed to Privileged Account and does not need to be configured.
-
For Enterprise Edition, Basic Edition, and Data Lakehouse Edition clusters, select Privileged Account.
New Password
The password for the privileged account. The password must meet the requirements shown in the console.
Confirm Password
Enter the password again to confirm.
Description
An optional description to help you manage the account.
-
-
Click OK to create the account.
Create standard accounts and grant permissions
Console operations
You can create and grant permissions to a standard account in the console only for Enterprise Edition, Basic Edition, and Data Lakehouse Edition clusters.
-
Log on to the AnalyticDB for MySQL console. In the upper-left corner of the console, select a region. In the left-side navigation pane, click Clusters. Find the cluster that you want to manage and click the cluster ID.
-
In the left-side navigation pane, click Accounts.
-
Click Create Account.
-
In the Create Account panel, set the following parameters.
Parameter
Description
Database Account
The name of the standard account. The name must meet the requirements shown in the console.
Account Type
Select Standard Account.
NoteIf you want to use a RAM user to perform SQL development in the Enterprise Edition, Basic Edition, or Data Lakehouse Edition console, you must associate the RAM user with this standard account after you create the standard account.
New Password
The password for the standard account. The password must meet the requirements shown in the console.
Confirm Password
Enter the password again to confirm.
Description
An optional description to help you manage the account.
-
Click OK.
-
After the account is created, click Permissions in the Actions column for the account to configure its permissions.
Change an account password
If you forget a database account password, you can reset it in the console.
For data security, we recommend that you change the password regularly.
On the Accounts page, click Change Password to the right of the account. Enter and confirm the new password as prompted, and then click OK.
SQL operations
You can use SQL statements to create and grant permissions to standard accounts for both Data Warehouse Edition and Enterprise Edition, Basic Edition, and Data Lakehouse Edition clusters. Standard accounts created using SQL statements appear in the console for Enterprise Edition, Basic Edition, and Data Lakehouse Edition clusters, but not for Data Warehouse Edition clusters. For Data Warehouse Edition clusters, you must run the SELECT User FROM mysql.user; statement to view the accounts.
You can use the following SQL operations to manage database accounts: