Create a database on a PolarDB-X instance

更新时间:
复制 MD 格式

Learn how to create a database on a PolarDB-X instance.

Procedure

  1. Log on to the PolarDB-X console.

  2. In the top navigation bar, select the region where the instance is deployed.

  3. On the Instances page, click the PolarDB-X 2.0 tab.

  4. Find the instance that you want to manage and click its ID.

  5. In the left-side navigation pane, choose Configuration and Management > Databases.

  6. In the upper-left corner of the Databases page, click Create Database.

  7. In the dialog box, configure the following parameters.

    Parameter

    Description

    Database name

    Note

    The database name must meet the following requirements:

    • Must be 2 to 32 characters long and contain only lowercase letters, digits, and underscores (_).

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

    • Must be unique within the instance.

    • The name test is reserved.

    Supported character set

    You can select utf8, gbk, latin1, or utf8mb4.

    Authorized account

    Select a standard account to grant access to this database.

    Note
    • Only standard accounts can be authorized. A privileged account has full permissions on all databases by default and does not require authorization.

    • If you do not have an account, click Create Account to create one. For more information, see Create an account.

    Account permissions

    Select permissions for the account. Valid values: Read and Write, Read Only, DDL Only, and DML Only.

    Mode

    Select AUTO or DRDS. This parameter is available only for Enterprise Edition instances.

    • AUTO mode: Uses manual partitioning by default. Run the SET GLOBAL AUTO_PARTITION=TRUE; command to enable automatic partitioning. You can then create tables without specifying a partition key, and the data is automatically and evenly distributed across the cluster.

    • DRDS mode: Uses manual partitioning by default and does not support automatic partitioning. When you create a table, you must use DRDS-specific sharding syntax to specify a sharding key. Otherwise, a non-partitioned table is created.

    For more information about the two modes, see Databases in AUTO mode and DRDS mode.

    Description

    Optional. Enter a description of up to 256 characters to help identify the database.

  8. Click OK.