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.
Prerequisites
Install the standalone CQLSH tool that is compatible with your DataStax database.
Procedure
-
Change to the directory where the tarball was extracted.
-
On the command line, run the
cqlsh
script. An example directory location of the script is/usr/bin
.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.cqlsh
You can optionally specify the IP address and port to interface with a remote DataStax database.
cqlsh host_name port
For example:
cqlsh 10.100.176.166 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 10.100.176.166 9042
-
Print the help menu for
cqlsh
.cqlsh --help
For a complete list, see cqlsh (startup options).