This topic describes how to create a database user.

Syntax

CREATE USER name [IDENTIFIED BY password]

Parameters

Parameter Description
name The name of the user.
password The password of the user.

Description

The CREATE USER statement is used to add a new user to a POLARDB cluster compatible with Oracle.

When the CREATE USER statement is executed, a schema will also be created with the same name as the new user and owned by the new user. Objects with unqualified names created by this user will be created in this schema.

Note
  • You must be a database superuser to use this statement.
  • The maximum length allowed for the user name and password is 63 characters.

Examples

Create a user and set the password.

CREATE USER user IDENTIFIED BY password;