Create a database account

更新时间:
复制 MD 格式

This topic describes how to create a database account and explains the differences between privileged 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 through the console or an API.

  • You can create multiple privileged accounts for a cluster. A privileged account can manage all standard accounts and databases.

  • Offers advanced permissions for personalized, fine-grained access control. For example, you can grant users query permissions on specific tables.

  • Has full permissions on all databases within the cluster.

  • Can disconnect any account connection.

Standard Account

  • Can be created and managed through the console, an API, or SQL statements.

  • You can create multiple standard accounts for a cluster. The number of accounts that you can create varies based on the database engine.

  • You must manually grant permissions on specific databases to a standard account.

  • A standard account cannot create, manage, or disconnect the connections of other accounts.

Create an account

  1. Log on to the PolarDB console.

  2. In the upper-left corner, select the region where the cluster is deployed.

  3. Find the target cluster and click its ID.

  4. In the left-side navigation pane, choose Configuration and Management > Accounts.

  5. Click Create Account.

  6. Set the following parameters.

    Parameter

    Description

    Account Name

    The account name must meet the following requirements:

    • Starts with a lowercase letter and ends with a lowercase letter or a digit.

    • Contains lowercase letters, digits, and underscores (_).

    • Must be 2 to 16 characters long.

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

    Account Type

    • To create a privileged account, select Privileged Account.

    • To create a standard account, select Standard Account.

    Password

    The password must meet the following requirements:

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

    • Must be 8 to 32 characters long.

    • The supported special characters are:

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

    Confirm Password

    Enter the password again.

    Description

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

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

    • Must start with a letter or a Chinese character.

    • Can contain letters, Chinese characters, digits, underscores (_), and hyphens (-).

    • Must be 2 to 256 characters long.

  7. Click OK.

What to do next

View or request an endpoint

Related APIs

API

Description

CreateAccount

Creates a database account.

DescribeAccounts

Queries database accounts.

ModifyAccountDescription

Modifies the description of a database account.

ModifyAccountPassword

Modifies the password of a database account.