You are here: Database Administration > About Database Access and Security > Assigning Database Access Levels

Assigning Database Access Levels

Assigning Access Levels to Users by Assigning Roles

Now that database roles have been created, the DBA can create database users and grant access to the database. Each user can then be assigned to an existing role. The user will then inherit the access privileges granted to that role.

One or more of the examples below make use of tables defined in the HOCKEY schema, which is a schema defined in the test database. The test database is created when the QuickStart process is run. See Running the SQL QuickStart.

For example:

CREATE USER coach_user PASSWORD 'CoAc4u$er';
GRANT coach_role TO coach_user;
 
CREATE USER player_user PASSWORD '!P1ay3ru$er';
GRANT player_role TO player_user;
 
CREATE USER fan_user PASSWORD 'password1';
GRANT fan_role TO fan_user;

Assigning Access Levels Directly to Users

GRANT INSERT, UPDATE, DELETE, SELECT ON players TO coach_user;
GRANT SELECT,INSERT, UPDATE ON scoring TO player_user;
GRANT SELECT ON teams TO fan_user;
COMMIT;

Changing Passwords

NuoDB does not enforce changing passwords. However, users should change their passwords periodically. Use the ALTER USER command to change a user password.

ALTER USER fan_user PASSWORD 'passwd2';