Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SAP Sybase SQL Anywhere 16.0 » SQL Anywhere Server - Database Administration » User and database security » User security (roles and privileges) » Users

 

Creating a user (SQL)

Create a user by using the CREATE USER statement.

Prerequisites

You must have the MANAGE ANY USER system privilege.

Context and remarks

  • User IDs cannot:

    • begin with white space, single quotes, or double quotes
    • end with white space
    • contain semicolons
  • Passwords are case-sensitive and they cannot:

    • begin with white space, single quotes, or double quotes
    • end with white space
    • contain semicolons
    • be longer than 255 bytes in length
 Task
  1. Connect to the database.

  2. Execute a CREATE USER statement that contains an IDENTIFIED BY clause.

    By default, users are assigned the root login policy. If you need to assign a user a different login policy, you can specify it by using the LOGIN POLICY clause of the CREATE USER statement.

Results

A user is created and the specified login policy is assigned to the user. If no login policy was specified, the root login policy is applied.

Next

Grant roles or privileges to the user.

Example

This example adds a new user to the database with the user ID of M_Haneef and a password of Welcome.

CREATE USER M_Haneef
IDENTIFIED BY Welcome;

 See also