Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register

Versions available for this page: CUBRID 8.3.0 |  CUBRID 8.3.1 |  CUBRID 8.4.0 |  CUBRID 8.4.1 |  CUBRID 8.4.3 |  CUBRID 9.0.0 | 

Managing User

Description

DBA and DBA members can create, drop and alter users by using SQL statements. At the initial installation, passwords for users are not configured.

Syntax

CREATE USER user_name

[ PASSWORD password ]

[ GROUPS user_name [ {, user_name } ... ] ]

[ MEMBERS user_name [ {, user_name } ... ] ] ;

DROP USER user_name;

ALTER USER user_name PASSWORD password;

  • user_name: Specifies the user name to create, delete or change.
  • password: Specifies the user password to create or change.
Example 1

The following example shows how to create a user (Fred), change a password, and delete the user.

CREATE USER Fred;

ALTER USER Fred PASSWORD '1234';

DROP USER Fred;

Example 2

The following example shows how to create a user and add member to the user. By the following statement, company becomes a group that has engineering, marketing and design as its members. marketing becomes a group with members smith and jones, design becomes a group with a member smith, and engineering becomes a group with a member brown.

CREATE USER company;

CREATE USER engineering GROUPS company;

CREATE USER marketing GROUPS company;

CREATE USER design GROUPS company;

CREATE USER smith GROUPS design, marketing;

CREATE USER jones GROUPS marketing;  

CREATE USER brown GROUPS engineering;

Example 3

The following example shows how to create the same groups as above but use the MEMBERS keyword instead of GROUPS.

CREATE USER smith;

CREATE USER brown;

CREATE USER jones;

CREATE USER engineering MEMBERS brown;

CREATE USER marketing MEMBERS smith, jones;

CREATE USER design MEMBERS smith;

CREATE USER company MEMBERS engineering, marketing, design;