Updated on 2025-03-28 GMT+08:00

Creating a Database

Scenarios

After your GaussDB(for MySQL) instance is created, you can create databases on it.

Constraints

  • This operation is not allowed when another operation is being performed on your DB instance.
  • After a database is created, the database name cannot be changed.

Procedure

  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, choose Database > GaussDB(for MySQL).
  4. On the Instances page, click the instance name.
  5. In the navigation pane, choose Databases. On the displayed page, click Create Database. In the displayed dialog box, enter a database name, select a character set, and authorize permissions for users. Then, click OK.

    Table 1 Parameter description

    Parameter

    Description

    Database Name

    The database name can consist of 1 to 64 characters. Only letters, digits, hyphens (-), and underscores (_) are allowed. The total number of hyphens (-) cannot exceed 10.

    Character Set

    Select a character set as required.

    User

    • You can select one or more unauthorized users. If there are no unauthorized users, you can create one.

    Remarks

    The remarks can consist of up to 512 characters. It cannot contain carriage returns or any of the following special characters: !<"='>&

  6. After the database is created, authorize or delete it on the Databases page. You can search for the desired database by character set and database name.

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, choose Database > GaussDB(for MySQL).
  4. On the Instances page, locate the instance and click Log In in the Operation column.
  5. On the displayed login page, enter the username and password and click Log In.
  6. Create a database.

    You can use either of the following methods to create a database:

    1. On the home page, click Create Database. In the displayed dialog box, set the database name, character set, and collation, and click OK.
    2. Choose SQL Operations > SQL Query. In the displayed SQL window, select the target database and run the following command:
      create database database_name;