# No suitable mariadb driver found

**URL:** <https://discuss.elastic.co/t/no-suitable-mariadb-driver-found/127380>\
**Category:** Logstash\
**Created:** [April 9, 2018, 8:06pm UTC](https://discuss.elastic.co/t/no-suitable-mariadb-driver-found/127380 "2018-04-09T20:06:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rsaeks](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rsaeks/32/5068_2.png) [@rsaeks](https://discuss.elastic.co/u/rsaeks)\
**Post date:** [April 9, 2018, 8:06pm UTC](https://discuss.elastic.co/t/no-suitable-mariadb-driver-found/127380/1 "2018-04-09T20:06:40Z")

</div>

Hi there,

I've been trying to get logstash to connect to a mariadb instance without any luck. My config is pretty basic with:

```
input {
  jdbc {
    jdbc_connection_string => "jdbc:mariadb://192.168.40.202:3306/munkireport"
    jdbc_user => "munkireport"
    jdbc_password => "munkireport"
    jdbc_driver_library => "/opt/jdbc/mariadb-java-client-2.2.3.jar"
    jdbc_driver_class => "org.mariadb.jdbc.Driver"
    statement => "SELECT serial_number, hostname, os_version FROM `munkireport`.`machine`;"
    }
 }

```

And is returning the following error when trying to connect:

```
[2018-04-09T14:19:52,815][ERROR][logstash.pipeline] A plugin had an unrecoverable error. Will restart this plugin. Pipeline_id:main Plugin: <LogStash::Inputs::Jdbc jdbc_connection_string=>"jdbc:mariadb://192.168.40.202:3306/munkireport", jdbc_user=>"munkireport", jdbc_password=><password>, jdbc_driver_library=>"/opt/jdbc/mariadb-java-client-2.2.3.jar", jdbc_driver_class=>"org.mariadb.jdbc.Driver", statement=>"SELECT serial_number, hostname, os_version FROM `munkireport`.`machine`;", id=>"ede5f6baf9ecbff57b0f5af0185955f9dd528a8c3bd8be3bd7963b2e24e9fd9f", enable_metric=>true, codec=><LogStash::Codecs::Plain id=>"plain_c3797e2f-3e5a-4806-9eed-a76c4772cf1b", enable_metric=>true, charset=>"UTF-8">, jdbc_paging_enabled=>false, jdbc_page_size=>100000, jdbc_validate_connection=>false, jdbc_validation_timeout=>3600, jdbc_pool_timeout=>5, sql_log_level=>"info", connection_retry_attempts=>1, connection_retry_attempts_wait_time=>0.5, parameters=>{"sql_last_value"=>1969-12-31 18:00:00 -0600}, last_run_metadata_path=>"/usr/share/logstash/.logstash_jdbc_last_run", use_column_value=>false, tracking_column_type=>"numeric", clean_run=>false, record_last_run=>true, lowercase_column_names=>true> Error: Java::JavaSql::SQLException: No suitable driver found for jdbc:mariadb://192.168.40.202:3306/munkireport Exception: Sequel::DatabaseConnectionError Stack: java.sql.DriverManager.getConnection(java/sql/DriverManager.java:689)

```

I've successfully tested the connection from another machine, so I know the permissions and access are correct for the connection to the database.

Is there anything else I can check or a sample config others have working connecting to a mariadb via the jdbc connection?

---

<div class="post-metadata">

**Author:** ![yaauie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yaauie/32/23363_2.png) [@yaauie](https://discuss.elastic.co/u/yaauie)\
**Post date:** [April 9, 2018, 10:33pm UTC](https://discuss.elastic.co/t/no-suitable-mariadb-driver-found/127380/2 "2018-04-09T22:33:31Z")

</div>

Looking at the code for the [JDBC input plugin](https://github.com/logstash-plugins/logstash-input-jdbc/blob/master/lib/logstash/plugin_mixins/jdbc.rb), I'm not seeing anything in particular; if the driver jar were missing, or if the specified driver class failed to load, we would have blown up in a more helpful manner. Additionally, the source of [MariaDB's JDBC Driver](https://github.com/MariaDB/mariadb-connector-j/blob/2.2.3/src/main/java/org/mariadb/jdbc/Driver.java) indicates that it should report that it _does_ support any url that starts with `"jdbc:mariadb:"`, so once it is registered, Sequel should pick it up.

What versions of Logstash and JDBC input plugin are you using?

```auto
$LS_HOME/bin/logstash --version

```

```auto
$LS_HOME/bin/logstash-plugin list --verbose logstash-input-jdbc

```

The resolved version of `sequel`, which the logstash-input-jdbc plugin uses as a bridge, may also be helpful:

```auto
cat $LS_HOME/Gemfile.lock | grep sequel

```

---

<div class="post-metadata">

**Author:** ![rsaeks](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rsaeks/32/5068_2.png) [@rsaeks](https://discuss.elastic.co/u/rsaeks)\
**Post date:** [April 10, 2018, 7:03pm UTC](https://discuss.elastic.co/t/no-suitable-mariadb-driver-found/127380/3 "2018-04-10T19:03:06Z")

</div>

@yaauie - Thank you the reply back. I ran through all the versions and decided to see if the logstash-input-jdbc driver needed an update (after getting back 4.3.5) after updating the plugin to version 4.3.9 and re-loading, I was then able to use the input successfully!

Thank you so much for the assistance!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 8, 2018, 7:03pm UTC](https://discuss.elastic.co/t/no-suitable-mariadb-driver-found/127380/4 "2018-05-08T19:03:08Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
