Help Center/
MapReduce Service/
Component Operation Guide (LTS) (Ankara Region)/
Using Doris/
Typical SQL Syntax/
Creating a Database
Updated on 2024-11-29 GMT+08:00
Creating a Database
This topic describes the basic SQL syntax and example statements for creating Doris databases.
Basic Syntax
CREATE DATABASE [IF NOT EXISTS] db_name
[PROPERTIES ("key"="value", ...)];
Example
- Connect to Doris through MySQL client as a user with Doris administrator permissions.
- Run the following statement to create the database example_db:
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 statement to switch to example_db:
use example_db;
Parent topic: Typical SQL Syntax
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot