Create and manage databases in a or cluster.
Create a database
-
Go to the PolarDB console. In the left-side navigation pane, choose .
-
Click Create Database, configure the following parameters, and then click OK.
Parameter
Description
Database (DB) name
The database name. Must meet the following requirements:
-
Starts with a letter and ends with a letter or a digit.
-
Must be 2 to 64 characters in length.
-
Can contain only lowercase letters, digits, hyphens (
-), and underscores (_).
Note-
The database name must be unique within the cluster.
-
The database name cannot be changed after creation.
-
Do not use reserved keywords, such as
test, as the database name.
Database Owner
The database owner, who has ALL privileges on the database. Leave empty to change the database owner later.
Supported character sets
The character set. Default: UTF8. Select a different value from the drop-down list if needed.
Collate
The string sort order. Default: C. For less common languages, select en_US.utf8.
C type
The character classification. Determined by the Collation setting.
Notes and Remarks
Optional. Must meet the following requirements:
-
Cannot start with http:// or https://.
-
Must be 2 to 256 characters in length.
-
Can contain uppercase letters, lowercase letters, Chinese characters, digits, underscores (
_), and hyphens (-).
-
Delete a database
Deleting a database permanently erases all its data. This action cannot be undone.
-
Go to the PolarDB console. In the left-side navigation pane, choose .
-
Find the target database and click Delete in the Operation column. In the confirmation dialog, click OK.
Change the database owner
-
Go to the PolarDB console. In the left-side navigation pane, choose .
-
Find the target database and click Change Owner in the Operation column.
-
In the Change Owner dialog, select a new owner for the database and click OK.
Related APIs
|
API |
Description |
|
Creates a database in a PolarDB cluster. |
|
|
Deletes a database from a PolarDB cluster. |
|
|
Queries database details in a PolarDB cluster. |