# JDBC Input plugin doesn't forward username and password to MySQL

**URL:** https://discuss.elastic.co/t/jdbc-input-plugin-doesnt-forward-username-and-password-to-mysql/141148
**Category:** Logstash
**Created:** [July 23, 2018, 11:06am UTC](https://discuss.elastic.co/t/jdbc-input-plugin-doesnt-forward-username-and-password-to-mysql/141148 "2018-07-23T11:06:04Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Mor\_Paz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mor_paz/32/33634_2.png) [@Mor\_Paz](https://discuss.elastic.co/u/Mor_Paz)
#### Post date: [July 23, 2018, 11:06am UTC](https://discuss.elastic.co/t/jdbc-input-plugin-doesnt-forward-username-and-password-to-mysql/141148/1 "2018-07-23T11:06:04Z")

</div>

I am trying to use the jdbc input plugin to get data from my MySQL DB to my Elasticsearch server, I have installed a mysql-connector-java-8.0.11-1.el7.noarch package and my Logstash is already running fine for other inputs (including beats and syslog).

Here is my input configruation:

```
input {
  jdbc {
    jdbc_connection_string => "jdbc:mysql://DB_IP:3306/KAS"
    jdbc_user => "user"
    jdbc_password => "password"
    jdbc_driver_library => "/usr/share/java/mysql-connector-java-8.0.11.jar"
    jdbc_driver_class => "com.mysql.cj.jdbc.Driver"
    schedule => "* * * * *"
    statement => "SELECT * from alerts"
    type => "mysql"
  }
}

```

The driver is loaded correctly but the connection to the DB is never made, here is the error I see in the log files:

`[2018-07-23T13:58:00,069][ERROR][logstash.inputs.jdbc] Unable to connect to database. Tried 1 times {:error_message=>"Java::JavaSql::SQLException: Access denied for user ''@'SOURCE_IP' (using password: NO)"}`

It seems that the logstash input doesn't pickup the user and the password from my config file, but I can't understand why.

---

<div class="post-metadata">

### Author: ![Mor\_Paz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mor_paz/32/33634_2.png) [@Mor\_Paz](https://discuss.elastic.co/u/Mor_Paz)
#### Post date: [July 23, 2018, 11:46am UTC](https://discuss.elastic.co/t/jdbc-input-plugin-doesnt-forward-username-and-password-to-mysql/141148/2 "2018-07-23T11:46:02Z")

</div>

I figured out the problem, apparently the jdbc input plugin wasn't updated. After using the `logstash-plugin` command to update the plugin it began working perfectly.

---

<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 20, 2018, 11:48am UTC](https://discuss.elastic.co/t/jdbc-input-plugin-doesnt-forward-username-and-password-to-mysql/141148/3 "2018-08-20T11:48:39Z")

</div>

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