Connect to DSE with the CQL shell (cqlsh)

The CQL shell (cqlsh) is a Python-based command-line shell you can use to issue Cassandra Query Language (CQL) statements to your DataStax Enterprise (DSE) databases. The CQL shell also provides unique cqlsh commands like DESCRIBE KEYSPACE.

Start the CQL shell and connect to a node

Start cqlsh from the directory where it is installed. For example, for the tarball-bundled CQL shell, run cqlsh from the bin directory of your DSE installation:

bin/cqlsh

Starting cqlsh with no arguments attempts to connect to the local node without authentication.

To connect to a remote node, provide the IP address of the target node:

bin/cqlsh IP_ADDRESS

If the node requires authentication, provide the required credentials. The following example uses internal username and password authentication. For other options, like Kerberos authentication and SSL encryption, see Use a cqlshrc file.

bin/cqlsh IP_ADDRESS -u DATABASE_ROLE_NAME -p DATABASE_ROLE_PASSWORD

Credentials passed on the command line can be stored in your shell history. To avoid this, pass only the -u option, or use a cqlshrc file. If you pass -u without -p, cqlsh prompts for the password instead of storing it in your shell history.

Use a cqlshrc file

As an alternative to command line arguments, you can store these values in a cqlshrc file that cqlsh reads automatically at startup. For more information, see Use a cqlshrc file.

Run commands with the CQL shell

A successful connection shows the connection details and the cqlsh prompt:

Connected to Test Cluster at 127.0.0.1:9042
Connected to dse-6.9.0-cluster at 127.0.0.1:9042.
[cqlsh 6.8.0 | DSE 6.9.0 | CQL spec 3.4.5 | DSE protocol v2]
Use HELP for help.
cqlsh>

At the cqlsh prompt, issue CQL or cqlsh commands.

Troubleshoot the CQL shell

If cqlsh cannot connect, and it mentions a different port than 9042, make sure your ~/.cassandra/cqlshrc file isn’t modifying the default port.

For command help, run cqlsh --help.

For detailed logs, start cqlsh or run any cqlsh command with the --debug option.

Was this helpful?

Give Feedback

How can we improve the documentation?

© Copyright IBM Corporation 2026 | Privacy policy | Terms of use |  Manage Privacy Choices

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: Contact IBM