How to list all the available keyspaces in Cassandra?
Its very simple. Just give the below command for listing all keyspaces.
Cqlsh> Describe keyspaces;
If you want to check the keyspace in the system schema using the SQL query
below is the command.
SELECT * FROM system_schema.keyspaces;
Hope this will answer your question...
You can go through the explanation on understanding and creating the keyspaces from below resources.
Documentation:
https://docs.datastax.com/en/cql/3.1/cql/cql_reference/create_keyspace_r.html https://www.i2tutorials.com/cassandra-tutorial/cassandra-create-keyspace/
[cqlsh 4.1.0 | Cassandra 2.0.4 | CQL spec 3.1.1 | Thrift protocol 19.39.0]
Currently, the command to use is:
DESC[RIBE] keyspaces;
If you want to do this outside of the cqlsh
tool you can query the schema_keyspaces
table in the system
keyspace. There's also a table called schema_columnfamilies
which contains information about all tables.
The DESCRIBE
and SHOW
commands only work in cqlsh
and cassandra-cli
.