# No suitable driver found for jdbc

**URL:** <https://discuss.elastic.co/t/no-suitable-driver-found-for-jdbc/70957>\
**Category:** Logstash\
**Created:** [January 9, 2017, 3:39pm UTC](https://discuss.elastic.co/t/no-suitable-driver-found-for-jdbc/70957 "2017-01-09T15:39:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![JohnG](https://avatars.discourse-cdn.com/v4/letter/j/f4b2a3/32.png) [@JohnG](https://discuss.elastic.co/u/JohnG)\
**Post date:** [January 9, 2017, 3:39pm UTC](https://discuss.elastic.co/t/no-suitable-driver-found-for-jdbc/70957/1 "2017-01-09T15:39:40Z")

</div>

Hi,

Hope someone can help.

I have the following jar files in a directory named /etc/logstash/jars/

-rw-r--r-- 1 logstash logstash 987191 Jan 9 15:08 mysql-connector-java-5.1.38.jar  
-rw-r--r-- 1 logstash logstash 987191 Jan 6 14:47 mysql.jar

I have the following in my logstash.conf file (_critical values have been replaced for this post_) ;

jdbc {  
jdbc\_driver\_library =\> "/etc/logstash/jars/mysql-connector-java-5.1.38.jar"  
jdbc\_driver\_class =\> "com.mysql.jdbc.Driver"  
jdbc\_connection\_string =\> "jdbc:IP Address:3306/dbName"  
jdbc\_user =\> "UserName  
jdbc\_password =\> "password"  
schedule =\> "\* \* \* \* \*" # every minute  
statement =\> "select \* from Table"  
type =\> "Type"  
}

and yet I'm getting this error -

[2017-01-09T15:19:15,065][ERROR][logstash.agent] Pipeline aborted due to error {:exception=\>#\<Sequel::DatabaseConnectionError: Java::JavaSql::SQLException: No suitable driver found for jdbc:xxxx. . .

What am I missing? The jar file is where it's supposed to be and the config file is looking in the place.

Any help is much appreciated.

---

<div class="post-metadata">

**Author:** ![talevy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/talevy/32/44896_2.png) [@talevy](https://discuss.elastic.co/u/talevy)\
**Post date:** [January 9, 2017, 8:57pm UTC](https://discuss.elastic.co/t/no-suitable-driver-found-for-jdbc/70957/2 "2017-01-09T20:57:21Z")

</div>

just to be sure you are using the right driver.

when I fetched the driver from: [https://downloads.mysql.com/archives/get/file/mysql-connector-java-5.1.38.zip](https://downloads.mysql.com/archives/get/file/mysql-connector-java-5.1.38.zip), I saw that the driver file was `983914` bytes. Probably not related.

Another thing I see is that you do not list the type in the connection string. mysql's connection string has a `mysql` in it.

e.g. `jdbc:mysql://localhost:3306/testdb`

is that what you tried?

---

<div class="post-metadata">

**Author:** ![JohnG](https://avatars.discourse-cdn.com/v4/letter/j/f4b2a3/32.png) [@JohnG](https://discuss.elastic.co/u/JohnG)\
**Post date:** [January 10, 2017, 8:47am UTC](https://discuss.elastic.co/t/no-suitable-driver-found-for-jdbc/70957/3 "2017-01-10T08:47:35Z")

</div>

Thanks Tal.

I've added the 'mysql' to the string and the error has been fixed.

Thanks again.

---

<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:** [February 7, 2017, 8:48am UTC](https://discuss.elastic.co/t/no-suitable-driver-found-for-jdbc/70957/4 "2017-02-07T08:48:00Z")

</div>

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