Before you write and query data, you must create a database. This topic describes how to use Data Management (DMS) to create a database.

Limits

You can create up to 256 databases in each ApsaraDB ClickHouse cluster.

Prerequisites

The following steps listed in Quick Start are completed:

Procedure

  1. On the SQL Console page in the DMS console, execute the CREATE DATABASE statement to create a database.
    • Syntax:
      CREATE DATABASE [IF NOT EXISTS] db [ON CLUSTER default]
    • Parameter description:
      db_name: the name of the database. A database name can be up to 64 characters in length and can contain letters, digits, and underscores (_). The database name must start with a lowercase letter and cannot contain consecutive underscores (_).
      Note You cannot use the word system as the database name because system is reserved as the name of the built-in database. For more information, see CREATE DATABASE.
    • Example:
      create database if not exists clickhouse_demo ON CLUSTER default; 
  2. In the upper-left corner, click execute(F8). The database is created.

What to do next

Create a table.