Assigning Database Access Levels
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.
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;
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;
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';