10

Has anyone had any success with connecting to a Cassandra cluster using DBeaver Community Edition? I've tried to follow this post, but haven't had any success. I have to have authentication enabled, and I get an error saying:

Authentication error on host /x.x.x.x:9042: Host /x.x.x.x:9042 requires authentication, but no authenticator found in Cluster configuration

Erick Ramirez
  • 13,964
  • 1
  • 18
  • 23
Joel
  • 8,502
  • 11
  • 66
  • 115
  • Have you tried [setting an authenticator](https://docs.datastax.com/en/cassandra-oss/3.x/cassandra/configuration/secureConfigNativeAuth.html) in your cassandra.yaml file? – RyanQuey Sep 02 '21 at 09:56
  • @RyanQuey I don't personally have access to the cluster, but I guess I could check with those that do. However, I've been able to connect using other tools: TablePlus, Cassandra Workbench, etc. If that changes anything? – Joel Sep 02 '21 at 10:19
  • Erick Ramirez answer _mostly_ worked for me. I did manage to get a connection, but I never figured out how to get dbeaver to properly work with dates. By default they were displayed in local time, and queries with filters on exact timestamps did not work. What did work very well for me was the Cassandra integration in JetBrains Rider. (I guess it's the same as for [JetBrains IntelliJ](https://www.jetbrains.com/help/idea/apache-cassandra.html)) – Joel Dec 09 '21 at 18:21
  • It is so difficult to get right, I am just going to get my job to buy me a license. Spent half a day trying to figure this out, no success. If anybody finds a way, you are a genius! – Randy L Aug 17 '23 at 18:08

1 Answers1

44

Overview

DataStax offers the JDBC driver from Magnitude (formerly Simba) to users at no cost so you should be able to use it with DBeaver.

These are the high-level steps for connecting to a Cassandra cluster with DBeaver:

  1. Download the Simba JDBC driver from DataStax
  2. Import the Simba JDBC driver
  3. Create a new connection to your cluster

Download the driver

  1. Go to https://downloads.datastax.com/#odbc-jdbc-drivers.
  2. Select Simba JDBC Driver for Apache Cassandra.
  3. Select JDBC 4.2.
  4. Accept the license terms (click the checkbox).
  5. Hit the blue Download button.
  6. Once the download completes, unzip the downloaded file.

Import the driver

In DBeaver, go to the Driver Manager and import the Simba JDBC driver as follows:

  1. Click the New button
  2. In the Libraries tab, click the Add File button
  3. Locate the directory where you unzipped the download and add the CassandraJDBC42.jar file.
  4. Click the Find Class button which should identify the driver class as com.simba.cassandra.jdbc42.Driver.
  5. In the Settings tab, set the following:
  • Driver Name: Cassandra
  • Driver Type: Generic
  • Class Name: com.simba.cassandra.jdbc42.Driver
  • URL Template: jdbc:cassandra://{host}[:{port}];AuthMech=1 (set authentication mechanism to 0 if your cluster doesn't have authentication enabled)
  • Default Port: 9042
  1. Click the OK button to save the driver.

At this point, you should see Cassandra as one of the drivers in the list.

Connect to your cluster

In DBeaver, create a new database connection as follows:

  1. Select Cassandra from the drivers list.
  2. In the Main tab of the JDBC connection settings, set the following:
  • Host: node_ip_address (this could be any node in your cluster)
  • Port: 9042 (or whatever you've set as rpc_port in cassandra.yaml)
  • Username: your_db_username
  • Password: your_db_password
  1. Click on the Test Connection button to confirm that the driver configuration is working.
  2. Click on the Finish button to save the connection settings.

At this point, you should be able to browse the keyspaces and tables in your Cassandra cluster. Cheers!


Please support the Apache Cassandra community by hovering over then click on the Watch tag button. Thanks!

Erick Ramirez
  • 13,964
  • 1
  • 18
  • 23
  • Just a follow up question. For some reason timestamp columns are presented in local time (instead of UTC). Can't find a setting to change it. Do you know how? – Joel Sep 02 '21 at 11:16
  • 1
    CQL timestamps are the number of milliseconds since Unix epoch so Cassandra just sends the value in the request response. The client/IDE decides what format/locale they are displayed. You'll need to consult the DBeaver docs to see if it's configurable. Cheers! – Erick Ramirez Sep 02 '21 at 11:46
  • Hi @ErickRamirez is it possible to connect to multiple nodes within the cluster via single connection string? i did try jdbc:cassandra://{host1}[:{port1}],{host2}[:{port2}];AuthMech=1 but no luck – Arun Mohan Sep 16 '21 at 09:53
  • @ArunMohan it is not. Cheers! – Erick Ramirez Sep 17 '21 at 04:55
  • Any way to add/upload .pem (generated by Aiven.io which wraps various cloud providers) for SSL connection? Getting com.simba.cassandra.shaded.datastax.driver.core.exceptions.TransportException when Testing Connection . – Sint Jul 14 '22 at 14:54
  • It seems there is no New/Libraries tab anymore (MacOS DBeaver Version 22.1.0.202206051253). Go for Database/Driver manager. All the other steps are same. – DenisNovac Sep 14 '22 at 11:32
  • step No. 4 is not showing in my case even after selecting the jar fie – oldMonk Nov 15 '22 at 18:48
  • Cannot get this to work on a Mac at all. I just grabbed a trial Enterprise license instead. Is good to buy stuff from fellow developers! – Randy L Aug 10 '23 at 17:48
  • 1
    Simba JDBC drivers got removed https://community.jaspersoft.com/wiki/announcing-removal-insightsoftware-simba-jdbc-drivers-simba-drivers-jaspersoft-product-suite – DenisNovac Aug 15 '23 at 13:43