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.

  1. Create a new superuser account:

    CREATE ROLE <your_root_account_name>
        WITH SUPERUSER = true
        AND LOGIN = true
        WITH PASSWORD = '<role_password>';
  2. Make sure the account exists:

    LIST ROLE <your_root_account_name>;
  3. Grant the new superuser account the ALL permission:

    GRANT ALL PERMISSIONS ON ALL KEYSPACES TO <your_root_account_name>;
  4. Check that the new superuser account has the ALL permission:

    LIST ALL PERMISSIONS OF <your_root_account_name>;
  5. Delete the default cassandra superuser account:

    DROP ROLE cassandra;
  6. Make sure the cassandra account is deleted:

    LIST ROLE cassandra;

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2024 DataStax | Privacy policy | Terms of use

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: +1 (650) 389-6000,