All Products
Search
Document Center

AnalyticDB:Create a database account

Last Updated:Apr 27, 2025

AnalyticDB for MySQL supports two types of database accounts: privileged accounts and standard accounts. You can use a privileged account to manage all the standard accounts and databases. For standard accounts, you must manually create them and grant permissions to perform database operations.

Account types

AnalyticDB for MySQL supports two types of database accounts: privileged accounts and standard accounts. The following table describes the differences between privileged accounts and standard accounts.

Account type

Description

Privileged account

  • You can create and manage privileged accounts only in the console.

  • You can create only a single privileged account for each cluster. The privileged account can be used to manage all standard accounts and databases of the cluster.

  • You can use a privileged account to close all database connections that are established by a standard account.

  • The privileged account allows you to implement fine-grained permission control to suit your business requirements. For example, you can grant each standard account the permissions to query specific tables.

  • A privileged account in AnalyticDB for MySQL is equivalent to a root account in MySQL.

Standard account

  • For Data Warehouse Edition clusters, you can create standard accounts only by using SQL statements.

  • For Enterprise Edition, Basic Edition, and Data Lakehouse Edition clusters, you can create standard accounts by using both SQL statements and console operations.

  • You can create up to 256 standard accounts for a cluster.

  • You must manually grant a standard account the permissions to access specific databases. For more information, see GRANT and Database permission model.

  • You cannot use a standard account to close the database connections that are established by other standard accounts.

Create a privileged account

  1. 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. On the Clusters page, click an edition tab. Find the cluster that you want to manage and click the cluster ID.

  2. In the left-side navigation pane, click Accounts.

  3. 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 described in the following table.

  • For Data Warehouse Edition clusters, click Create Privileged Account. In the Create Privileged Account panel, configure the parameters described in the following table.

Parameter

Description

Database Account

The name of the privileged account. Enter a name that meets the on-screen requirements.

Account Type

  • For Data Warehouse Edition clusters, this parameter is automatically set to Privileged Account.

  • For Enterprise Edition, Basic Edition, and Data Lakehouse Edition clusters, select Privileged Account.

New Password

The password of the privileged account. Enter a password that meets the on-screen requirements.

Confirm Password

Enter the password of the privileged account again.

Description

Optional. The description that is used to identify the account for future management.

  1. Click OK.

Create and grant permissions to a standard account

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.

  1. 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. On the Clusters page, click an edition tab. Find the cluster that you want to manage and click the cluster ID.

  2. In the left-side navigation pane, click Accounts.

  3. Click Create Account.

  4. In the Create Account panel, configure the parameters described in the following table.

    Parameter

    Description

    Database Account

    The name of the standard account. Enter a name that meets the on-screen requirements.

    Account Type

    The type of the account. Select Standard Account.

    Note

    If you want to use a Resource Access Management (RAM) user to perform SQL development in the AnalyticDB for MySQL console for Enterprise Edition, Basic Edition, and Data Lakehouse Edition clusters, you must create a standard account and associate the standard account with the RAM user.

    New Password

    The password of the standard account. Enter a password that meets the on-screen requirements.

    Confirm Password

    Enter the password of the standard account again.

    Description

    Optional. The description that is used to identify the account for future management.

  5. Click OK.

  6. Find the created account and click Permissions in the Actions column to grant permissions to the account.

Change the password of a database account

If you forget the password of a database account, you can change the password in the console.

Important

For data security purposes, we recommend that you change account passwords on a regular basis.

On the Accounts page, find the database account for which you want to change the password and click Change Password in the Actions column. In the Change Password panel, enter and confirm a new password as prompted, and then click OK.

SQL statements

You can create and grant permissions to a standard account by executing SQL statements for both Data Warehouse Edition and Enterprise Edition, Basic Edition, and Data Lakehouse Edition clusters. The standard accounts created by using SQL statements are displayed in the console only for Enterprise Edition, Basic Edition, and Data Lakehouse Edition clusters. To query the standard accounts created by using SQL statements for Data Warehouse Edition clusters, execute the SELECT User FROM mysql.user; statement.

SQL syntax for creation, authentication, and management of database accounts:

OSZAR »