# Logstash with Jdbc input plugin error

**URL:** https://discuss.elastic.co/t/logstash-with-jdbc-input-plugin-error/180633
**Category:** Logstash
**Created:** [May 11, 2019, 5:39am UTC](https://discuss.elastic.co/t/logstash-with-jdbc-input-plugin-error/180633 "2019-05-11T05:39:54Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![danish\_hyt](https://avatars.discourse-cdn.com/v4/letter/d/e495f1/32.png) [@danish\_hyt](https://discuss.elastic.co/u/danish_hyt)
#### Post date: [May 11, 2019, 5:39am UTC](https://discuss.elastic.co/t/logstash-with-jdbc-input-plugin-error/180633/1 "2019-05-11T05:39:54Z")

</div>

I am tring to connect mysql workbench 6.3 CE with logstash via jdbc plugin but i am having error which i am unable to figure out research on it but found no fix so that is why i am posting it here.

**OS: Windows 10**

**Logstash Config file**

```
input {
      jdbc { 
        jdbc_driver_library => "c:/mysql-connector-java-8.0.16.jar"
        jdbc_driver_class => "com.mysql.jdbc.Driver"
        jdbc_connection_string => "jdbc:mysql://localhost:3306/bestpricedb1?user=root&password=12345678"
        jdbc_user => "root"
    	statement => "SELECT * FROM visited_stores"
        }
      }

output {
  elasticsearch {
    hosts => ["http://localhost:9200"]
    index => "stores"
  }
  stdout {}
}

```

**Error** i am getting  
C:/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-jdbc-4.3.13/lib/logstash/plugin\_mixins/jdbc/jdbc.rb:221:in `execute_statement' C:/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-jdbc-4.3.13/lib/logstash/inputs/jdbc.rb:277:in`execute\_query'  
C:/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-jdbc-4.3.13/lib/logstash/inputs/jdbc.rb:263:in `run' C:/logstash/logstash-core/lib/logstash/java_pipeline.rb:297:in`inputworker'  
C:/logstash/logstash-core/lib/logstash/java\_pipeline.rb:290:in `block in start\_input'  
**[2019-05-11T10:37:29,239][ERROR][logstash.inputs.jdbc] Failed to load c:/mysql-connector-java-8.0.16.jar {:exception=\>#\<TypeError: failed to coerce jdk.internal.loader.ClassLoaders$AppClassLoader to java.net.URLClassLoader\>}**  
**[2019-05-11T10:37:29,242][ERROR][logstash.javapipeline] A plugin had an unrecoverable error. Will restart this plugin.**  
Pipeline\_id:main  
Plugin: \<LogStash::Inputs::Jdbc jdbc\_user=\>"root", statement=\>"SELECT \* FROM visited\_stores", jdbc\_driver\_library=\>"c:/mysql-connector-java-8.0.16.jar", jdbc\_connection\_string=\>"jdbc:mysql://localhost:3306/bestpricedb1?user=root&password=12345678", id=\>"6f33b5f49281a1bbb802689a1e7d04766aea9e5c90d7a9802c2d154ad5347cf2", jdbc\_driver\_class=\>"com.mysql.jdbc.Driver", enable\_metric=\>true, codec=\>\<LogStash::Codecs::Plain id=\>"plain\_f86d0811-0452-4843-b9e0-6c322fabb8fb", 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"=\>1970-01-01 00:00:00 UTC}, last\_run\_metadata\_path=\>"C:\Users\Hp/.logstash\_jdbc\_last\_run", use\_column\_value=\>false, tracking\_column\_type=\>"numeric", clean\_run=\>false, record\_last\_run=\>true, lowercase\_column\_names=\>true\>  
**Error: com.mysql.jdbc.Driver not loaded. Are you sure you've included the correct jdbc driver in :jdbc\_driver\_library?**  
Exception: LogStash::ConfigurationError

**Tried version of jdbc\_driver\_library**  
mysql-connector-java-5.1.36  
mysql-connector-java-5.1.44-bin.jar  
mysql-connector-java-8.0.16.jar

---

<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: [June 8, 2019, 5:40am UTC](https://discuss.elastic.co/t/logstash-with-jdbc-input-plugin-error/180633/2 "2019-06-08T05:40:00Z")

</div>

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