This topic describes how to create a database account for an AnalyticDB for MySQL cluster and explains the differences between privileged accounts and standard accounts.

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 typeDescription
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 privilege account in AnalyticDB for MySQL is equivalent to a root account in MySQL.
Standard account
  • For a Data Warehouse Edition (V3.0) cluster, you can create standard accounts only by using SQL statements. For more information, see CREATE USER.
  • For a Data Lakehouse Edition (V3.0) cluster, you can create standard accounts by using both SQL statements and console operations. For more information, see CREATE USER and Create and grant permissions to a standard account.
  • 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.
  2. In the upper-left corner of the page, select the region where the cluster resides.
  3. In the left-side navigation pane, click Clusters.
  4. Click the Data Lakehouse Edition (V3.0) or Data Warehouse Edition (V3.0) tab based on your cluster type.
  5. Find the cluster that you want to manage and click its ID.
  6. In the left-side navigation pane, click Accounts.
  7. For a Data Warehouse Edition (V3.0) cluster, click Create Privileged Account. For a Data Lakehouse Edition (V3.0) cluster, click Create Account.
  8. In the Create Privileged Account or Create Account panel, configure the parameters described in the following table.
    ParameterDescription
    AccountThe name of the privileged account. Enter a name that meets the on-screen requirements.
    Account Type
    • For a Data Warehouse Edition (V3.0) cluster, this parameter is automatically set to Privileged Account.
    • For a Data Lakehouse Edition (V3.0) cluster, select Privileged Account.
    PasswordThe password of the privileged account. Enter a password that meets the on-screen requirements.
    Confirm PasswordEnter the password of the privileged account again.
    DescriptionOptional. The description that is used to identify the account for future management.
  9. 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 Data Lakehouse Edition (V3.0) clusters.

  1. Log on to the AnalyticDB for MySQL console.
  2. In the upper-left corner of the page, select the region where the cluster resides.
  3. In the left-side navigation pane, click Clusters.
  4. On the Data Lakehouse Edition (V3.0) tab, find the cluster that you want to manage and click its ID.
  5. In the left-side navigation pane, click Accounts.
  6. Click Create Account.
  7. In the Create Account panel, configure the parameters described in the following table.
    ParameterDescription
    AccountThe name of the standard account. Enter a name that meets the on-screen requirements.
    Account TypeSelect Standard Account.
    PasswordThe password of the standard account. Enter a password that meets the on-screen requirements.
    Confirm PasswordEnter the password of the standard account again.
    DescriptionOptional. The description that is used to identify the account for future management.
  8. Click OK.
  9. Find the created account and click Permission Management in the Actions column to grant permissions to the account.

SQL statements

You can create and grant permissions to a standard account by executing SQL statements for both Data Warehouse Edition (V3.0) and Data Lakehouse Edition (V3.0) clusters. The standard accounts created by using SQL statements for Data Warehouse Edition (V3.0) clusters are not displayed in the console.
  • For more information about how to create a database account, see CREATE USER.
  • For more information about how to grant permissions to a database account, see GRANT.
  • For more information about how to revoke permissions from a database account, see REVOKE.
  • For more information about how to change the name of a database account, see RENAME USER.
  • For more information about how to delete a database account, see DROP USER.