The Cassandra Query Language SHell (CQLSH) is a command line shell for interacting with your database through Cassandra Query Language (CQL). This tool provides a useful interface for accessing the database and issuing CQL commands.
Each DataStax Astra DB database includes an embedded CQL shell instance. In Astra Portal, navigate to your database and click the CQL Console tab to open a CQLSH instance that is connected to your database. Issue CQL commands directly to your Astra DB database without navigating outside of your browser.
To see the CQL console in a full browser window, use this URL format:
Once you open the CQL shell in Astra, you will automatically be signed in and connected to your database.
Instead of using the native CQL shell that is included in DataStax Enterprise (DSE), the standalone CQLSH client is a separate, lightweight tool you can use to interact with your database.
Each DataStax Astra DB database includes an embedded CQL shell instance. In Astra Portal, navigate to your database and click the CQL Console tab to open a CQLSH instance that is connected to your database.
To connect to your Astra DB database using the drivers, download the secure database bundle from the DataStax Astra Portal that contains the connection credentials.
Open a browser, navigate to Astra DB, and log in.
From your Dashboard page, select your database.
On the Overview page, select Connect.
In the Select a Method section, select Drivers and then Legacy from the dropdown menu to select your driver type from the list to load language-specific instructions.
Java and Node.js are available as legacy and cloud native drivers.
If you have multiple regions, select the region you want to connect to from the dropdown menu for instructions.
The bundle URL is the same for all languages.
Click Download Bundle.
If you have multiple regions, you will have the option to download a bundle for each region from the expanded Download Bundle drop-down menu.
The secure-connect-database_name.zip file downloads, which contains the security certificates and credentials for your database.
Although teammates can access your Astra DB database, it will not display in their list of available databases under My Databases in Astra Portal.
After you create an Astra DB database, you can grant access to other members of your team by providing them with the database credentials and connection details for your database.
Be careful when sharing connection details. Providing this information to another user grants them access to your Astra DB database and ownership capabilities, such as making modifications to the database.
For security, delete downloaded connection credentials after sending them to your teammate.
Alternatively, have a teammate provide access to their Astra database.
Change to the directory where you downloaded the CQLSH tarball and then extract it:
$ cd /<download_directory> $ tar -xvf cqlsh-astra-<date>-bin.tar.gz
date - The date that the tarball was released, such as 20210304.
From the directory where you extracted the CQLSH tarball, run the cqlsh script from the command line:
$ cd /cqlsh-astra $ ./bin/cqlsh -u **clientID** -p **clientSecret** -b /path/to/secure-connect**database_name**.zip
-b option to specify the location of the secure connect bundle that you downloaded for your database. Pass the Client Id and Client Secret for your database role using the
-p options. For more, see Manage application tokens.
username - Client ID for the database role.
password - Client secret for the specified Client ID.
database_name - Name of the Astra DB database to which you want to connect. Include the absolute path to the secure connect bundle for the database, such as /Users/myuser/Downloads/secure-connect-database123.zip.
You are connected directly to your database using CQLSH.
[cqlsh 6.8.0 | DSE 126.96.36.199 | CQL spec 3.4.5 | DSE protocol v2] Use HELP for help. username@cqlsh>
Switch to your
KEYSPACE, where you can issue CQL commands to create tables, insert data, and manage database resources: