Cannot create keyspace with cassandra with php Cannot create keyspace with cassandra with php docker docker

Cannot create keyspace with cassandra with php


Please don't use thobbs/phpcassa - it's very old, and it uses legacy Thrift protocol under the hood... The correct way is to work with Cassandra now is to use PHP driver from DataStax. Authentication is fully supported there (doc), like this:

$cluster = Cassandra::cluster()               ->withCredentials("username", "password")               ->build();$session = $cluster->connect();

And after you got $session, you can use execute function to execute CQL statements, like, CREATE KEYSPACE and CREATE TABLE, like this:

$session->execute('CREATE TABLE ...')

I recommend to learn about CQL (Cassandra Query Language) that replaced the Thrift long time ago. The good resource for it is "Cassandra. The definitive guide book" - the 3rd edition of it was recently released, and freely available from the DataStax site.