Updated on 2024-12-09 GMT+08:00
Databases
In MySQL, DATABASE is a schema object, which is equivalent to the SCHEMA of Oracle and GaussDB(DWS). DSC supports the following two scenarios:
- Database creation
create database IF NOT EXISTS dbname1 CHARACTER SET=utf8 COLLATE=utf8_unicode_ci; create database IF NOT EXISTS dbname2; drop database if exists dbname1; drop database if exists dbname2;
Output
CREATE SCHEMA "dbname1"; CREATE SCHEMA "dbname2"; DROP SCHEMA IF EXISTS "dbname1"; DROP SCHEMA IF EXISTS "dbname2";
- Database use
drop database if exists test; create database if not exists test; use test;
Output
DROP SCHEMA IF EXISTS "test"; CREATE SCHEMA "test"; SET CURRENT_SCHEMA = "test";
Parent topic: MySQL Syntax Migrating
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