Creating a user and role

This creates a new role called cassdba (as seen in Chapter 1, Quick Start) and gives it a password and the ability to log in and makes it a superuser:

CREATE ROLE cassdba WITH PASSWORD='flynnLives' AND LOGIN=true and SUPERUSER=true;

We can also create simple roles:

CREATE ROLE data_reader;CREATE ROLE data_test;

Creating non-superuser roles looks something like this:

CREATE ROLE kyle WITH PASSWORD='bacon' AND LOGIN=true;CREATE ROLE nate WITH PASSWORD='canada' AND LOGIN=true;

Get Mastering Apache Cassandra 3.x - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.