Syntax\n------\n\nCREATE [OR REPLACE] {DATABASE | SCHEMA} [IF NOT EXISTS] db_name\n    [create_specification] ...\n\ncreate_specification:\n    [DEFAULT] CHARACTER SET [=] charset_name\n  | [DEFAULT] COLLATE [=] collation_name\n  | COMMENT [=] 'comment'\n\nDescription\n-----------\n\nCREATE DATABASE creates a database with the given name. To use this statement, you need the CREATE privilege for the database. CREATE SCHEMA is a synonym for CREATE DATABASE.\n\nFor valid identifiers to use as database names, see Identifier Names.\n\nOR REPLACE\n\nIf the optional OR REPLACE clause is used, it acts as a shortcut for:\n\n``sql\nDROP DATABASE IF EXISTS db_name;\nCREATE DATABASE db_name ...;\n`\n\nIF NOT EXISTS\n\nWhen the IF NOT EXISTS clause is used, MariaDB will return a warning instead of an error if the specified database already exists.\n\nCOMMENT\n\nThe maximum length of a comment is 1024 bytes. If the comment length exceeds this length, an error/warning code 4144 is thrown. The database comment is also added to the db.opt` file, as well as to the information_schema.schemata table.\n\nComments added for databases do not exist.\n\nExamples\n--------\n\nCREATE DATABASE db1;\nQuery OK, 1 row affected (0.18 sec)\n\nCREATE DATABASE db1;\nERROR 1007 (HY000): Can't create database 'db1'; database exists\n\nCREATE OR REPLACE DATABASE db1;\nQuery OK, 2 rows affected (0.00 sec)\n\nCREATE DATABASE IF NOT EXISTS db1;\nQuery OK, 1 row affected, 1 warning (0.01 sec)\n\nSHOW WARNINGS;\n+-------+------+----------------------------------------------+\n| Level | Code | Message                                      |\n+-------+------+----------------------------------------------+\n| Note  | 1007 | Can't create database 'db1'; database exists |\n+-------+------+----------------------------------------------+\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/data-definition/create/create-database