Starting the standalone cqlsh tool

Steps to launch the standalone cqlsh tool to remotely access a DataStax database.

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 client for executing CQL commands interactively. The CQL shell supports tab completion. The cqlsh command run in either Python 2 or 3.

Prerequisites

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

Procedure

  1. Change to the directory where the tarball was extracted.
  2. On the command line, run the cqlsh script.
    The cqlsh shell connects to 127.0.0.1 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.
    ./bin/cqlsh

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

    ./bin/cqlsh host_name port

    For example:

    ./bin/cqlsh 10.100.176.166 9042

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

    ./bin/cqlsh -u username -p password host_name port

    For example:

    ./bin/cqlsh -u janeappdev -p j4nesp&swd 10.100.176.166 9042
  3. Optional: Print the help menu for cqlsh.
    ./bin/cqlsh --help
    Tip: For a complete list, see cqlsh (startup options).