All Products
Search
Document Center

PolarDB:Create a database

Last Updated:May 13, 2024

This topic describes how to create a database in a PolarDB-X instance.

Procedure

  1. Log on to the PolarDB for Xscale console.

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

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

  4. Find the target instance and click its ID.

  5. In the left-side navigation pane of the instance details page, choose Configuration Management > Database Management.

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

  7. In the dialog box that appears, configure the parameters that are described in the following table.

    Parameter

    Description

    Database Name

    The database name.

    Note

    The database name must meet the following requirements:

    • The name must be 2 to 32 characters in length and can contain lowercase letters, digits, and underscores (_).

    • The name must start with a lowercase letter and end with a lowercase letter or a digit.

    • The name must be unique within the instance.

    • The name cannot be test because test is a reserved keyword.

    Supported Character Set

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

    Authorized Account

    The account that you want to use to log on to the database.

    Note
    • Only standard accounts are available in the drop-down list. The privileged account of an instance has all permissions on all databases in the instance. You do not need to authorize the privileged account to access a database.

    • If no standard accounts are available, you can click Create Account to create a standard account. For more information, see Create an account.

    Account Permissions

    The permissions that you want to grant to the specified account. You can select Read and Write, Read Only, DDL Only, or DML Only.

    Mode

    You can select AUTO or DRDS.

    • AUTO: Databases in AUTO mode support automatic partitioning. When you create a table, you do not need to specify a partition key. Data in the table is automatically evenly distributed among partitions.

    • DRDS: Databases in DRDS mode do not support automatic partitioning. When you create a table, you can use the sharding syntax that is dedicated to PolarDB-X to specify a database shard key and a table shard key. If no database shard key or table shard key is specified, a non-partitioned table is created.

    For more information, see Databases in AUTO mode and DRDS mode.

    Description

    The database description. The description can help you identify the database. The description can be up to 256 characters in length.

  8. Click OK.