Overview
Scenarios
Product Architecture
Instance Types
Compatibility Notes
Usage specification recommendations
CREATE {DATABASE | SCHEMA} [IF NOT EXISTS] db_name[create_option] ...create_option: [DEFAULT] {CHARACTER_SET [=] charset_name| COLLATE [=] collation_name| ENCRYPTION [=] {'Y' | 'N'}}
CREATE DATABASE: creates a database with the given name. If the database already exists and IF NOT EXISTS is not specified, an error will be reported.create_option : Specifies a property of the database. The database properties are stored in the data dictionary.CHARACTER_SET : Specifies the default character set for the database.COLLATE: Specifies the default collation for the database.ENCRYPTION: Specifies the default encryption method for the database. Tables in the database will inherit this encryption method. Allowed values are 'Y' (enable encryption) and 'N' (disable encryption). If the ENCRYPTION option is not specified, the system variable default_table_encryption is used as the default encryption method for the database.business_system_name_subsystem_name format, with tables within the same module sharing a common prefix.# CREATE DATABASE db1; if it already exists, an error will be reportedCREATE DATABASE db1;# CREATE DATABASE db2; if it already exists, do nothingCREATE DATABASE IF NOT EXISTS db2;
Was this page helpful?
You can also Contact sales or Submit a Ticket for help.
Help us improve! Rate your documentation experience in 5 mins.
Feedback