Create superuser account
This page will give a brief example of using CQL to create a superuser account.
It will show how to replace the cassandra
superuser account with a new superuser account.
-
Create a new superuser account:
CREATE ROLE <your_root_account_name> WITH SUPERUSER = true AND LOGIN = true WITH PASSWORD = '<role_password>';
-
Make sure the account exists:
LIST ROLE <your_root_account_name>;
-
Grant the new superuser account the
ALL
permission:GRANT ALL PERMISSIONS ON ALL KEYSPACES TO <your_root_account_name>;
-
Check that the new superuser account has the
ALL
permission:LIST ALL PERMISSIONS OF <your_root_account_name>;
-
Delete the default
cassandra
superuser account:DROP ROLE cassandra;
-
Make sure the
cassandra
account is deleted:LIST ROLE cassandra;