azure-templateskong

Create a new user account

The Cassandra superuser is able to create new users and roles. To create a new user with an assigned role, you need to use the CREATE USER statement:

CREATE USER IF NOT EXISTS user_name WITH PASSWORD 'password'
  ( NOSUPERUSER | SUPERUSER )

These are some examples of how to create new users with authentication and authorization information:

CREATE USER mariah WITH PASSWORD 'password1' SUPERUSER;
CREATE USER john WITH PASSWORD 'password2' NOSUPERUSER;

To check the list of users and their privileges, execute the following command:

cassandra@cqlsh> LIST USERS;

name      | super
-----------+-------
cassandra |  True
mariah    |  True
john      |  False

This statement is equivalent to:

cassandra@cqlsh> LIST ROLES;

The Cassandra official documentation has more details about how to create users and roles.

Last modification September 4, 2018