How do you create the first user in Cassandra DB

后端 未结 4 552
逝去的感伤
逝去的感伤 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:34

    Change

    authenticator: AllowAllAuthenticator 
    

    To

    authenticator: PasswordAuthenticator 
    

    in cassandra.yamlconfiguration file and restart Cassandra.

    This will create a superuser cassandra for you with the restart. Make sure you have Phthon27, thrift-0.91, Cassandra ( datastax community edition 2.0.9 ) etc installed. Now when you login to cassandra, it will let you enter as superuser. You can now create new superuser and change existing superuser's password as well.

    python cqlsh localhost -u cassandra -p cassandra 
    Connected to Test Cluster at localhost:9160. 
    [cqlsh 4.1.1 | Cassandra 2.0.9 | CQL spec 3.1.1 | Thrift protocol 19.39.0]
    

    Use HELP for help.

    cqlsh> create user abc with password 'xyz' superuser; 
    cqlsh> alter user cassandra with password 'gaurav'; 
    cqlsh> exit
    

提交回复
热议问题