All Products
Search
Document Center

PolarDB:Create a database

Last Updated:Mar 28, 2026

Create a database in a PolarDB-X instance to organize data, control access at the database level, and set the partitioning mode for Enterprise Edition instances.

Prerequisites

Before you begin, ensure that you have:

  • A PolarDB-X instance

  • (Optional) A standard account to assign to the database. The privileged account has full permissions on all databases by default and does not need to be assigned. If no standard account exists, create one — see Create an account

  • (Enterprise Edition only) A decision on whether to use AUTO mode or DRDS mode — see Databases in AUTO mode and DRDS mode

Create a database

  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 and click the instance ID.

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

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

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

    ParameterDescriptionExample
    Database name2–32 characters. Allowed characters: lowercase letters, digits, and underscores (_). Must start with a lowercase letter and end with a lowercase letter or digit. Must be unique within the instance. The name test is reserved and cannot be used.mydb_01
    Supported character setThe character set for the database. Options: utf8, gbk, latin1, utf8mb4.utf8mb4
    Authorized accountThe standard account to grant access to this database. The privileged account already has full access to all databases and does not appear in this list.
    Account permissionsThe permissions to grant to the selected account. Options: Read and Write, Read Only, DDL Only, DML Only.Read and Write
    ModeThe database mode. Available only for Enterprise Edition instances. Options: AUTO or DRDS. See Mode options below.AUTO
    DescriptionA description to help identify the database. Maximum 256 characters.
  8. Click OK.

Mode options

The Mode parameter is available only for Enterprise Edition instances.

ModePartitioning behaviorWhen to use
AUTOManual partitioning by default. Run SET GLOBAL AUTO_PARTITION=TRUE; to enable automatic partitioning — PolarDB-X then distributes data evenly across partitions without requiring a partition key.General use; recommended for most workloads
DRDSManual partitioning only. Automatic partitioning is not supported. Specify a database shard key and a table shard key using PolarDB-X sharding syntax. If no shard key is specified, a non-partitioned table is created.Workloads that require explicit control over sharding logic

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

What's next

After the database is created, you can connect to it using the authorized account or manage account permissions from Configuration Management > Database Management.