Help Center/ CloudTable Service/ User Guide/ Using Doris/ Common SQL Commands of Doris/ Creating a Database
Updated on 2025-11-11 GMT+08:00
Creating a Database
This section describes the basic syntax and usage of the SQL statements for creating a database in a Doris cluster.
Basic Syntax
CREATE DATABASE [IF NOT EXISTS] db_name
[PROPERTIES ("key"="value", ...)]; Usage Example
- Connect to Doris through the MySQL client as a user with Doris administrator permissions.
- Run the following command to create the example_db database:
create database if not exists example_db;
- Run the following statement to view the database information:
SHOW DATABASES;
mysql> SHOW DATABASES; +--------------------+ | Database | +--------------------+ | example_db | | information_schema | +--------------------+ 2 rows in set (0.00 sec)
- Run the following command to switch to example_db:
use example_db;
Parent topic: Common SQL Commands of Doris
What is your overall rating for this page?
0
1
2
3
4
5
6
7
8
9
10
Very dissatisfiedVery satisfied
Thank you very much for your feedback. We will continue working to improve the documentation.
The system is busy. Please try again later.