Creates a database for a specified PolarDB cluster.
Before you call this operation, ensure that the following requirements are met:
- The cluster is in the running state.
- The cluster is not locked.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | No | CreateDatabase |
The operation that you want to perform. Set the value to CreateDatabase. |
CharacterSetName | String | Yes | utf8 |
The character set. For more information, see Character set. |
DBClusterId | String | Yes | pc-************** |
The ID of the cluster. |
DBName | String | Yes | testDB |
The name of the database. The name must meet the following requirements:
|
DBDescription | String | No | testdesc |
The description of the database. The description must meet the following requirements:
|
AccountName | String | No | testacc |
The name of the account that you use to connect to the database. You can call the DescribeAccounts operation to query the information of the account. Note You can only enter a standard account. By default, privileged accounts have full permissions.
|
AccountPrivilege | String | No | ReadWrite |
The permissions of the account. Valid values:
If you do not set this parameter, the default value is ReadWrite. Note This parameter is valid only when the AccountName parameter is specified.
|
Collate | String | No | C |
The language that specifies the collation of the new database. Note The language must be compatible with the character set that is specified by CharacterSetName.
|
Ctype | String | No | C |
The language that specifies the character classification for the database. Note
|
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | 93E98F25-BE02-40DA-83E3-F77F8D****** |
The ID of the request. |
Examples
Sample requests
http(s)://polardb.aliyuncs.com/? Action=CreateDatabase
&CharacterSetName=utf8
&DBClusterId=pc-**************
&DBName=testDB
&<Common request parameters>
Sample success responses
XML
format
<CreateDatabaseResponse>
<RequestId>93E98F25-BE02-40DA-83E3-F77F8D******</RequestId>
</CreateDatabaseResponse>
JSON
format
{
"RequestId": "93E98F25-BE02-40DA-83E3-F77F8D******"
}
Error codes
For a list of error codes, visit the API Error Center.