Updated on 2024-04-11 GMT+08:00

Creating a Database

Scenarios

After a DB instance is created, you can create databases on it.

Constraints

  • A maximum of 1,000 databases can be created for each DB instance.
  • Databases cannot be created when the DB instance is being restored or its instance class is being changed.
  • Database names must be unique.
  • After a database is created, the database name cannot be changed.

Creating a Database Through RDS

  1. Log in to the management console.
  2. Click in the upper left corner and select a region and a project.
  3. Click in the upper left corner of the page and choose Databases > Relational Database Service.
  4. On the Instances page, click the instance name.
  5. On the Databases page, click Create Database. In the displayed dialog box, enter a database name and click OK.

    Figure 1 Creating a database

    • The database name can contain 1 to 64 characters, and can include letters, digits, hyphens (-), underscores (_), and periods (.). It cannot start or end with an RDS for SQL Server system database name. RDS for SQL Server system databases include master, msdb, model, tempdb, resource, and rdsadmin.
    • The character set of the DB instance is used by default.

  6. After the database is created, manage it on the Databases page.

Creating a Database Through DAS

  1. Log in to the management console.
  2. Click in the upper left corner and select a region and a project.
  3. Click in the upper left corner of the page and choose Databases > Relational Database Service.
  4. On the Instances page, locate the DB instance and click Log In in the Operation column.
  5. On the displayed page, enter the username and password and click Log In.
  6. On the top menu bar, choose SQL Operations > SQL Query.
  7. Run the following command to create a database.

    create database database_name;