Creating a database

Last Updated: May 27, 2016

Description

Creates a new database in an instance. The interface must meet the following conditions, or the call will fail:

  • The instance status is Running
  • The instance is not locked
  • The maximum number of databases in the instance is not exceeded
  • The instance type is primary instance

NOTE: Users of PostgreSQL and PPAS instances are permitted to perform the CREATE DATABASE operation through SQL. Therefore, this interface does not support PostgreSQL and PPAS.

Request parameters

Name Type Required? Description
Action String Yes Required parameter. Value: CreateDatabase
DBInstanceId String Yes Instance ID
DBName String Yes Name of the database requiring a uniqueness check. It may consist of lower case letters, numbers and underlines, and must start with a letter
and have no more than 64 characters. For other illegal characters, refer to the Appendix
CharacterSetName String Yes Character set. The value range is limited to the following:
MySQL type:
utf8
gbk
latin1
utf8mb4 (included in versions 5.5 and 5.6).
SQLServer type:
Chinese_PRC_CI_AS
Chinese_PRC_CS_AS
SQL_Latin1_General_CP1_CI_AS
SQL_Latin1_General_CP1_CS_AS
Chinese_PRC_BIN
DBDescription String No Database description, which cannot exceed 256 characters. NOTE: It cannot begin with https://. It must start with a Chinese character or English letter.
It can include Chinese and English characters/letters, underlines (_), hyphens (-), and numbers. The length may be 2-256 characters

Return parameters

Name Type Description
<Public Return Parameters> - For details, refer to the Appendix

Example

  • Request example
  1. https://rds.aliyuncs.com/?Action=CreateDatabase
  2. &CharacterSetName=gbk
  3. &DBName=testdb02
  4. &DBInstanceId=riauvjz6zajfiq6ba1370329449201
  5. &<[Public Request Parameters]>
  • Return example

XML format:

  1. <CreateDatabaseResponse>
  2. <RequestId>5A77D650-27A1-4E08-AD9E-59008EDB6927</RequestId>
  3. </CreateDatabaseResponse>

JSON format:

  1. {
  2. "RequestID":"5A77D650-27A1-4E08-AD9E-59008EDB6927"
  3. }
Thank you! We've received your feedback.