In this article, we are going to discuss how to handle the superuser account in Cassandra. In this, we will learn how to create a superuser account, how to give permissions privilege to the other user, how to grant access, etc.
In Cassandra, it is the best practice concerning the handling of the default super user account “cassandra” is to create a custom administrator account. The superuser account helps Cassandra manages the role.
1. Creating a superuser account in Cassandra :
To create a superuser account used the following cqlsh query.
cassandra@cqlsh> create user 'admin' with password 'admin' superuser;
To see the superuser role information ‘admin’ we can use the list roles command.

Now, if we want to see all the information related to the superuser role then used the following cqlsh query.
cassandra@cqlsh> select * from system_auth.roles;
Output:

2. Logging into a superuser account :
Now, we are going to log in with admin (superuser) credentials.
cassandra@cqlsh> login admin Password: admin admin@cqlsh>
Output:

3. Granting the permissions :
Now, we will see how we can use the grant access on a specific keyspace such that if we want to read access on University keyspace to the ‘User’ role then we will use the grant command.
admin@cqlsh> grant select permission on keyspace University to 'User';
Now, we can see the permissions which are grant by the superuser for a specific role.
Output:

4. Logging into a normal user account :
To read data from student table and keyspace of student table is University.
Output:

Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.
Recommended Posts:
- Static type using batch in Cassandra
- Role of keys in Cassandra
- High Availability Mechanism in Cassandra
- Apache Cassandra tools
- Blob conversion function in Cassandra
- Designing models in Cassandra
- Introduction to Apache Cassandra
- Apache Cassandra (NOSQL database)
- Architecture of Apache Cassandra
- Overview of User Defined Type (UDT) in Cassandra
- Concept of indexing in Apache Cassandra
- Collection Data Type in Apache Cassandra
- Pre-defined data type in Apache Cassandra
- Monitoring cluster in Cassandra
- Virtual machine installation for Cassandra CQL query
- CAST function in Cassandra
- Data Manipulation in Cassandra
- Aggregate functions in Cassandra
- Database Roles in CQL (Cassandra Query Language)
- Static type in Cassandra
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

