All Apps and Add-ons

Splunk DB Connect 2: The driver class com.mysql.jdbc.Driver is not found

guahos
Explorer

Hey guys I need help!

What I'm trying to do:

I'm trying to get my Splunk 6.2.3 connected to a MySQL 5.5, running on Ubuntu.

What I've done:

  • Installed Splunk (with DB connect v2),
  • Installed MySQL (also created a DB and users, the DB is actually running and used now),

  • Installed JRE/JDK, the version is:

    # java -version
    java version "1.8.0_45"
    Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
    Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)

  • Downloaded ojdbc6.jar and placed it to /opt/splunk/etc/apps/splunk_app_db_connect/bin/lib/ojdbc6.jar

  • Set the proper JAVA_HOME path. (that made Splunk finally showing "RPC Service: Up")

  • Than I created a new Identity and Connection in Splunk DB Connect v2, and when I'm now trying to Validate the Connection, it shows me the error: The driver class com.mysql.jdbc.Driver is not found, please check if the driver library is installed properly.

  • Splunk internal log shows:

    Splunk internal log shows:2015-05-19 22:36:36 INFO HealthLogger:190 - DB_JDBC_URL=jdbc:mysql://192.168.20.15:3306/lif_1 FREE_MEMORY=47177448 FUNCTION=getConnectionStatus LABEL=JP MAX_MEMORY=1056309248 MESSAGE="The driver class com.mysql.jdbc.Driver is not found, please check if the driver library is installed properly." PROTOCOL=HTTP SQL_CODE=0 SQL_STATE=null STATE=error TOTAL_MEMORY=62849024 UPTIME=2476514 task_id=7f5ee0e0-a0ca-4c3b-8a2a-7d397548f14c

I suspect that the reason, causing this issue is with setting up the JDBC driver, looks like I missed a step during installation, or something like that.
Please help me to figure out what is going wrong and how could I finally get the MySQL data into Splunk.
Thanks in advance!

0 Karma
1 Solution

guahos
Explorer

Looks like that was resolved.

What I've done:

  • I've downloaded the MySQL Connector/J from the MySQL website

  • Then I've extracted the jar from archive to /opt/splunk/etc/apps/splunk_app_db_connect/bin/lib//libmysql-connector-java-5.0.8-bin.jar

  • Then I've cleared CLASSPATH from the old one, like sudo export CLASSPATH=

  • Then I set the new CLASSPATH sudo export CLASSPATH="/opt/splunk/etc/apps/splunk_app_db_connect/bin/libmysql-connector-java-5.0.8-bin.jar"

  • After that I restarted Splunk via web (Settings > System Controls > Restart Splunk)
    And that appears to be the solution.

View solution in original post

guahos
Explorer

Looks like that was resolved.

What I've done:

  • I've downloaded the MySQL Connector/J from the MySQL website

  • Then I've extracted the jar from archive to /opt/splunk/etc/apps/splunk_app_db_connect/bin/lib//libmysql-connector-java-5.0.8-bin.jar

  • Then I've cleared CLASSPATH from the old one, like sudo export CLASSPATH=

  • Then I set the new CLASSPATH sudo export CLASSPATH="/opt/splunk/etc/apps/splunk_app_db_connect/bin/libmysql-connector-java-5.0.8-bin.jar"

  • After that I restarted Splunk via web (Settings > System Controls > Restart Splunk)
    And that appears to be the solution.

esix_splunk
Splunk Employee
Splunk Employee

On a side note, the ojdbc6.jar file you were using is the Oracle driver, not the MySQL driver.

lrhazi
Path Finder

Hmm.. why would the CLASSPATH in your login session affect splunk process?

0 Karma
Get Updates on the Splunk Community!

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...