Database Reference
In-Depth Information
Dropping a trigger
A trigger can be dropped using the following pattern:
DROP TRIGGER trigger_name ON table_name;
Creating a user
Cassandra, by default, ships with authentication or authorization settings disabled. To be
able to create a user, you need to first enable it. Here is what you need to do:
1. Edit $CASSANDRA_HOME/conf/cassandra.yaml ; look for this line:
authenticator: AllowAllAuthenticator
Change the authenticator to the following line:
authenticator: PasswordAuthenticator
2. Restart Cassandra nodes. It is suggested to change the system_auth key-
space replication factor to more than one, so that your authentication does not
fail when the node containing data goes down.
3. The user's username and password is cassandra to log in the first time. For se-
curity reasons, it is suggested to create a new superuser then discard the Cas-
sandra user's superuser privilege.
To be on the safe side, you may also want to change the Cassandra user's password. From
now on, use the new superuser to perform tasks.
Here's how one uses cqlsh for the first login after setting up authentication.
$CASSANDRA_HOME/bin/cqlsh -u cassandra -p cassandra
localhost 9042
We will see more authentication and authorization in Chapter 4 , Deploying a Cluster .
Coming back to query definition, the following is the pattern to create a user:
CREATE USER [ IF NOT EXISTS ] user_name
[ WITH PASSWORD 'password' ]
[ NOSUPERUSER | SUPERUSER ];
Search WWH ::




Custom Search