CREATE DATABASE

Description

Create a database.

Syntax

  1. > CREATE DATABASE [IF NOT EXISTS] <database_name> [create_option] ...
  2. > create_option: [DEFAULT] {
  3. CHARACTER SET [=] charset_name
  4. | COLLATE [=] collation_name
  5. | ENCRYPTION [=] {'Y' | 'N'}
  6. }

create_database_statement:

Create Database Diagram

Examples

  1. > CREATE DATABASE test01;
  2. > CREATE DATABASE IF NOT EXISTS test01;
  3. > CREATE DATABASE test03 DEFAULT CHARACTER SET utf8 collate utf8_general_ci ENCRYPTION 'Y';
  4. > CREATE DATABASE test04 CHARACTER SET=utf8 collate=utf8_general_ci ENCRYPTION='N';

Constraints

Only UTF-8 CHARACTER SET is supported for now.