# Mysql input is showing error

**URL:** <https://discuss.elastic.co/t/mysql-input-is-showing-error/191568>\
**Category:** Logstash\
**Created:** [July 22, 2019, 4:48am UTC](https://discuss.elastic.co/t/mysql-input-is-showing-error/191568 "2019-07-22T04:48:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pathri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pathri/32/54484_2.png) [@pathri](https://discuss.elastic.co/u/pathri)\
**Post date:** [July 22, 2019, 4:48am UTC](https://discuss.elastic.co/t/mysql-input-is-showing-error/191568/1 "2019-07-22T04:48:27Z")

</div>

i want to fetch data from MySQL, below is the config file

input {  
jdbc {  
jdbc\_driver\_library =\> "mysql-connector-java-5.1.36-bin.jar"  
jdbc\_driver\_class =\> "com.mysql.jdbc.Driver"  
jdbc\_connection\_string =\> "jdbc:mysql://x.x.x.x:3306/xxx"  
jdbc\_user =\> "xxx"  
statement =\> "SELECT \* from xxx"  
}  
}

output{  
elasticsearch { hosts =\> ["localhost:9200"]  
index =\> "orders"  
}  
}

on running this config file below error is coming

[2019-07-22T10:12:28,324][ERROR][logstash.javapipeline] A plugin had an unrecoverable error. Will restart this plugin.  
Pipeline\_id:main  
Plugin: \<LogStash::Inputs::Jdbc jdbc\_user=\>"xxx", statement=\>"SELECT \* from xxx", jdbc\_driver\_library=\>"mysql-connector-java-5.1.36-bin.jar", jdbc\_connection\_string=\>"jdbc:mysql://xxx:3306/xxx", id=\>"2e0c46047eb17e2480245116ac5ec1305ab79e36e8f98e32cc92dc464d648422", jdbc\_driver\_class=\>"com.mysql.jdbc.Driver", enable\_metric=\>true, codec=\>\<LogStash::Codecs::Plain id=\>"plain\_bf3ee759-0641-40a0-90ef-7c7b2b7dbefc", 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=\>"/.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  
Stack: /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-jdbc-4.3.13/lib/logstash/plugin\_mixins/jdbc/jdbc.rb:163:in `open_jdbc_connection' /usr/share/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'  
/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-jdbc-4.3.13/lib/logstash/inputs/jdbc.rb:277:in `execute_query' /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-jdbc-4.3.13/lib/logstash/inputs/jdbc.rb:263:in`run'  
/usr/share/logstash/logstash-core/lib/logstash/java\_pipeline.rb:297:in `inputworker' /usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:290:in`block in start\_input'

please help me in understanding what is the reason and how to resolve this?

Thanks in advance

---

<div class="post-metadata">

**Author:** ![Makra](https://avatars.discourse-cdn.com/v4/letter/m/8491ac/32.png) [@Makra](https://discuss.elastic.co/u/Makra)\
**Post date:** [July 22, 2019, 5:04am UTC](https://discuss.elastic.co/t/mysql-input-is-showing-error/191568/2 "2019-07-22T05:04:32Z")

</div>

> [@pathri](#):
>
> Error: com.mysql.jdbc.Driver not loaded. Are you sure you've included the correct jdbc driver in :jdbc\_driver\_library?

I think you are missing the full path for jdbc\_driver\_library

` jdbc_driver_library=/path/to/mysql-connector-java-5.1.36-bin.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:** [August 19, 2019, 5:16am UTC](https://discuss.elastic.co/t/mysql-input-is-showing-error/191568/3 "2019-08-19T05:16:10Z")

</div>

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