All Products
Search
Document Center

PolarDB:Create and manage database accounts

Last Updated:Apr 18, 2026

This topic describes how to create and manage PolarDB for MySQL database accounts and explains the differences between privileged accounts and standard accounts.

Background information

PolarDB supports two types of database accounts: privileged accounts and standard accounts. You can manage all accounts in the console.

Note

For security reasons, PolarDB does not provide a root account.

Account type

Description

Privileged Account

  • Can be created and managed only in the console.

  • Each cluster can have only one privileged account. This account can manage all standard accounts and databases in the cluster.

  • Can create databases and standard accounts. It can also grant a standard account permissions on a specific database, which allows the standard account to add, delete, modify, and query data in that database.

  • Provides more permissions to meet custom and fine-grained permission management needs. For example, query permissions on different tables can be assigned to different users.

  • Can disconnect any account.

Standard Account

  • Can be created and managed in the console or using SQL statements.

  • A cluster can have multiple standard accounts. The specific number depends on the database kernel.

  • Does not have permissions to create databases or standard accounts. Can manage only authorized databases.

  • Cannot manage other accounts or disconnect other accounts.

Global Read-only Account

  • Can be created and managed in the console or using SQL statements.

  • Cannot create or manage databases.

  • Does not have permissions to create databases or standard accounts. Can only view databases.

  • A cluster can have multiple global read-only accounts. By default, these accounts have read-only permissions on all data.

  • Cannot manage other accounts or disconnect other accounts.

Create a privileged account

  1. Log on to the PolarDB console. Select the region where the destination cluster is located. On the Clusters page, click the ID of the destination cluster to navigate to the product page.

  2. In the navigation pane on the left, choose Settings and Management > Accounts.

  3. Click Create Account.

  4. In the Create Account panel, you can set the following parameters:

    Parameter

    Description

    Account Name

    Enter a name for the account. The account name must meet the following requirements:

    • Must start with a lowercase letter and end with a letter or a digit.

    • Can contain lowercase letters, digits, and underscores (_).

    • Must be 2 to 32 characters in length.

    • Cannot be a reserved username, such as root or admin.

    Account Type

    Select Privileged Account.

    Note
    • If a privileged account already exists, you cannot select Privileged Account again because each cluster can have only one privileged account.

    • For more information about the permissions of a privileged account, see Privileged account.

    Password

    Set a password for the account. The password must meet the following requirements:

    • Must contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters.

    • Must be 8 to 32 characters in length.

    • Special characters are:

      !@#$%^&*()_+-=~

    Confirm Password

    Enter the password again.

    Description

    Enter a description for the account to help with future account management. The description must meet the following requirements:

    • Cannot start with http:// or https://.

    • Must be 2 to 256 characters in length.

  5. Click OK.

Create a standard account

  1. Log on to the PolarDB console. Select the region where the destination cluster is located. On the Clusters page, click the ID of the destination cluster.

  2. In the navigation pane on the left, choose Settings and Management > Accounts.

  3. Click Create Account.

  4. In the Create Account dialog box, set the following parameters:

    Parameter

    Description

    Account Name

    Enter a name for the account. The account name must meet the following requirements:

    • Must start with a lowercase letter and end with a letter or a digit.

    • Can contain lowercase letters, digits, and underscores (_).

    • Must be 2 to 32 characters in length.

    • Cannot be a reserved username, such as root or admin.

    Account Type

    Select Standard Account.

    Authorized Databases

    Grant permissions on one or more databases to the account. You can also leave this parameter empty and grant permissions after the account is created.

    1. From the Unauthorized Database list, select one or more databases and click the icon icon to add them to the Authorized Database list.

    2. In the Authorized Database list, set the permission for the destination database to Read/Write, Read-only, DML Only, DDL Only, or Read-only + Index.

    Note
    • To customize permission combinations or grant table-level permissions, click Customize Permissions below the Unauthorized Database list. You can use the permission management feature of Data Management (DMS) for flexible control. For more information, see Manage database accounts and permissions.

    • To manage many databases, grant permissions in batches. Each batch should not exceed 80 databases.

    Password

    Set a password for the account. The password must meet the following requirements:

    • Must contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters.

    • Must be 8 to 32 characters in length.

    • Special characters are:

      !@#$%^&*()_+-=~

    Confirm Password

    Enter the password again.

    Description

    Enter a description for the account to help with future account management. The description must meet the following requirements:

    • Cannot start with http:// or https://.

    • Must be 2 to 256 characters in length.

  5. Click OK.

Create a global read-only account

  1. Log on to the PolarDB console and select the region where the cluster is located. On the Clusters page, click the ID of the destination cluster to open the product page.

  2. In the navigation pane on the left, choose Settings and Management > Accounts.

  3. Click Create Account.

  4. In the Create Account dialog box, set the following parameters:

    Parameter

    Description

    Account Name

    Enter a name for the account. The account name must meet the following requirements:

    • Must start with a lowercase letter and end with a letter or a digit.

    • Can contain lowercase letters, digits, and underscores (_).

    • Must be 2 to 32 characters in length.

    • Cannot be a reserved username, such as root or admin.

    Account Type

    Select Global Read-only Account.

    Authorized Databases

    By default, the account has read-only permissions on all data.

    Password

    Set a password for the account. The password must meet the following requirements:

    • Must contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters.

    • Must be 8 to 32 characters in length.

    • Special characters are:

      !@#$%^&*()_+-=~

    Confirm Password

    Enter the password again.

    Description

    Enter a description for the account to help with future account management. The description must meet the following requirements:

    • Cannot start with http:// or https://.

    • Must be 2 to 256 characters in length.

Reset permissions for a privileged account

If a privileged account has issues, such as its permissions being accidentally revoked, you can reset the permissions to restore the account to its initial state.

  1. Log on to the PolarDB console. Select the region where the destination cluster is located. On the Clusters page, click the destination cluster ID to navigate to the product page.

  2. In the navigation pane on the left, choose Settings and Management > Accounts.

  3. In the Actions column for the destination account, click Reset Permissions.

  4. In the dialog box, enter the privileged account password and click OK to reset the permissions.

Modify permissions for a standard account

  1. Log on to the PolarDB console. Select the region where the cluster is located. On the Clusters page, click the ID of the destination cluster to navigate to the product page.

  2. In the navigation pane on the left, choose Settings and Management > Accounts.

  3. Find the destination account and in the Actions column, click Modify Permissions.

  4. In the Modify Permissions dialog box, modify the authorized databases and their permissions, and then click OK.

Modify permissions for a global read-only account

  1. Log on to the PolarDB console and select the region where the destination cluster is located. On the Clusters page, click the ID of the destination cluster to open its product page.

  2. In the navigation pane on the left, choose Settings and Management > Accounts.

  3. Find the destination account and in the Actions column, click Modify Permissions.

  4. In the Modify Permissions dialog box, modify the permissions for the authorized databases and click OK.

    Note
    • Granting read and write permissions to specific databases does not affect the global read-only permission of the account.

    • After permissions are granted to a specific database, the Type column still displays Global Read-only Account, but the Authorized Databases column displays the permissions for that specific database.

Modify account permissions from the command line

You can use a privileged account to modify permissions by running the following command:

GRANT privileges ON databasename.tablename TO 'username'@'host' WITH GRANT OPTION;

Parameter

Description

privileges

The operation permissions to grant to the account, such as SELECT, INSERT, and UPDATE. To grant all permissions, use ALL.

Note

If you grant SELECT, LOCK TABLES, and SHOW VIEW permissions on all tables in all databases without granting any write permissions, the account is displayed as a global read-only account.

databasename

The name of the database. To grant permissions on all databases, use an asterisk (*).

tablename

The name of the table. To grant permissions on all tables, use an asterisk (*).

username

The account to be granted permissions.

host

The host from which the account is allowed to log on. To allow the account to log on from any host, use a percent sign (%).

Note

If you create a custom logon account without using a percent sign (%), you must log on to the DMS console with a privileged system account and run the operations to delete the authorized account.

WITH GRANT OPTION

Grants the account permission to use the GRANT command. This parameter is optional.

Delete an account

  1. Log on to the PolarDB console. Select the region where the destination cluster is located. On the Clusters page, click the ID of the destination cluster to open the product page.

  2. In the navigation pane on the left, choose Settings and Management > Accounts.

  3. Find the destination account and click Delete in the Actions column.

  4. In the Delete Account dialog box, click OK.

Related APIs

API

Description

CreateAccount

Creates an account.

DescribeAccounts

Queries a list of accounts.

ModifyAccountDescription

Modifies the description of an account.

ModifyAccountPassword

Modifies the password of an account.

GrantAccountPrivilege

Grants permissions to an account.

RevokeAccountPrivilege

Revokes permissions from an account.

ResetAccount

Resets the permissions of an account.