Starting the standalone cqlsh tool

Launch the standalone cqlsh tool to remotely access a DataStax database.

Execute the cqlsh Python script to start the CQL shell. The CQL shell is a Python-based command line interface for running CQL commands interactively. The CQL shell supports tab completion. The cqlsh command runs in either Python 2 or 3.


Install the standalone CQLSH tool that is compatible with your DataStax database.


  1. Change to the directory where the tarball was extracted.

  2. On the command line, run the cqlsh script. An example directory location of the script is /usr/bin.

    The cqlsh shell connects to 9042 by default. To change the defaults, set the $CQLSH_HOST and $CQLSH_PORT environment variables. When a host and optional port number are given on the command line, they take precedence over any defaults.


    You can optionally specify the IP address and port to interface with a remote DataStax database.

    cqlsh host_name port

    For example:

    cqlsh 9042

    If you use security features, provide the username and password to authenticate with the database:

    cqlsh -u username -p password host_name port

    For example:

    cqlsh -u janeappdev -p j4nesp&swd 9042
  3. Print the help menu for cqlsh.

    cqlsh --help

    For a complete list, see cqlsh (startup options).

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2024 DataStax | Privacy policy | Terms of use

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: +1 (650) 389-6000,