How do you create the first user in Cassandra DB

后端 未结 4 553
逝去的感伤
逝去的感伤 2021-01-01 13:37

How does one create the first user in a cassandra database?

I tried:

CREATE USER username WITH PASSWORD \"\";

and its says:

4条回答
  •  悲&欢浪女
    2021-01-01 14:28

    Once you have enabled Authentication and Authorization, you can log-in (to your local Cassandra instance) as the default Cassandra admin user like this:

    ./cqlsh localhost -u cassandra -p cassandra
    

    If you are running Cassandra on a Windows Server, I believe you need to invoke it with Python:

    python cqlsh localhost -u cassandra -p cassandra
    

    Once you get in, your first task should be to create another super user account.

    CREATE USER dba WITH PASSWORD 'bacon' SUPERUSER;
    

    Next, it is a really good idea to set the current Cassandra super user's password to something else...preferably something long and incomprehensible. With your new super user, you shouldn't need the default Cassandra account again.

    ALTER USER cassandra WITH PASSWORD 'dfsso67347mething54747long67a7ndincom4574prehensi562ble';
    

    For more information, check out this DataStax article: A Quick Tour of Internal Authentication and Authorization Security in DataStax Enterprise and Apache Cassandra

提交回复
热议问题