This topic describes how to create a database in a PolarDB-X instance.
Procedure
Log on to the PolarDB-X console.
In the top navigation bar, select the region where the instance is deployed.
On the Instances page, click the PolarDB-X 2.0 tab.
Find the instance that you want to manage and click the instance ID.
In the left-side navigation pane of the instance details page, choose .
In the upper-left corner of the Database Management page, click Create Database.
In the dialog box that appears, configure the parameters that are described in the following table.
Parameter
Description
Database Name
The database name.
NoteThe 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.
NoteOnly 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. This parameter is available only if the PolarDB-X instance is of Enterprise Edition and is not available if the PolarDB-X instance is of Standard Edition.
AUTO: Manual partitioning is used by default. You can execute the
SET GLOBAL AUTO_PARTITION=TRUE;
command to enable automatic partitioning. After that, you do not need to specify a partition key when you create a table. Data in the table is automatically evenly distributed among partitions.DRDS: Manual partitioning is used by default. Automatic partitioning is not supported for databases in DRDS mode. 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.
Click OK.