This topic describes the CREATE DATABASE statement and how to use it.
Prerequisites
Ensure that the current user has the CREATE privilege. For information about how to view your privileges, see View user privileges. If you do not have the CREATE privilege, contact the administrator to grant it. For information about how to grant privileges, see Grant privileges directly.
Procedure
Log in to a user tenant of the cluster.
Use the
CREATE DATABASEstatement to create a database.Examples:
Create a database named
test2and set its character set toUTF8.obclient> CREATE DATABASE test2 DEFAULT CHARACTER SET UTF8;Create a database named
test3with read/write attributes.obclient> CREATE DATABASE test3 READ WRITE;Create a database named
test4with read-only attributes.obclient> CREATE DATABASE test4 READ ONLY;
References
For more information about the syntax of the CREATE DATABASE statement, see CREATE DATABASE.