# JDBC connects to different ip as configured

**URL:** <https://discuss.elastic.co/t/jdbc-connects-to-different-ip-as-configured/125867>\
**Category:** Logstash\
**Created:** [March 28, 2018, 6:30am UTC](https://discuss.elastic.co/t/jdbc-connects-to-different-ip-as-configured/125867 "2018-03-28T06:30:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![MegaThorx](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/megathorx/32/29297_2.png) [@MegaThorx](https://discuss.elastic.co/u/MegaThorx)\
**Post date:** [March 28, 2018, 6:30am UTC](https://discuss.elastic.co/t/jdbc-connects-to-different-ip-as-configured/125867/1 "2018-03-28T06:30:47Z")

</div>

The `logstash-input-jdbc` plugin ignores my server ip which it should connect to.

I'm running `Logsasth 6.2.2` in docker and added the `MariaDB Java Client v2.2.3` to it. I also tried the `MySQL Connect Java 5.1.36` but got the same issue.

Config

```auto
input {
  jdbc {
    jdbc_connection_string => "jdbc:mariadb://213.201.98.188:6000/vrp_public_logs"
    jdbc_user => "MegaThorx"
    jdbc_password => "password"
    jdbc_validate_connection => true
    jdbc_driver_library => "/usr/share/logstash/logstash-core/lib/jars/mariadb-java-client-2.2.3.jar"
    jdbc_driver_class => "org.mariadb.jdbc.Driver"
    statement => "SELECT * FROM vrpLogs_Kills"
  }
}

```

Error from logstash

```auto
logstash_1 | [2018-03-28T06:15:47,900][ERROR][logstash.pipeline] A plugin had an unrecoverable error. Will restart this plugin.
logstash_1 | Pipeline_id:main
logstash_1 | Plugin: <LogStash::Inputs::Jdbc jdbc_connection_string=>"jdbc:mariadb://213.201.98.188:6000/vrp_public_logs", jdbc_user=>"MegaThorx", jdbc_password=><password>, jdbc_validate_connection=>true, jdbc_driver_library=>"/usr/share/logstash/logstash-core/lib/jars/mariadb-java-client-2.2.3.jar", jdbc_driver_class=>"org.mariadb.jdbc.Driver", statement=>"SELECT * FROM vrpLogs_Kills", id=>"a1c0dc9a18680d9aeacc058cced8642552b50551ae45d1c62ea34af5dfd58d84", enable_metric=>true, codec=><LogStash::Codecs::Plain id=>"plain_2784196e-7300-499f-910e-1191871096a1", enable_metric=>true, charset=>"UTF-8">, jdbc_paging_enabled=>false, jdbc_page_size=>100000, 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=>"/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>
logstash_1 | Error: Java::JavaSql::SQLInvalidAuthorizationSpecException: Access denied for user 'MegaThorx'@'192.168.122.10' (using password: YES)
logstash_1 | Exception: Sequel::DatabaseConnectionError
logstash_1 | Stack: org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.get(org/mariadb/jdbc/internal/util/exceptions/ExceptionMapper.java:173)

```

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [March 28, 2018, 7:05am UTC](https://discuss.elastic.co/t/jdbc-connects-to-different-ip-as-configured/125867/2 "2018-03-28T07:05:32Z")

</div>

> The logstash-input-jdbc plugin ignores my server ip which it should connect to.

What makes you say that? The logs indicate that it's trying to connect to 213.201.98.188 as configured. Isn't 192.168.122.10 _your_ IP address?

---

<div class="post-metadata">

**Author:** ![MegaThorx](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/megathorx/32/29297_2.png) [@MegaThorx](https://discuss.elastic.co/u/MegaThorx)\
**Post date:** [March 28, 2018, 7:13am UTC](https://discuss.elastic.co/t/jdbc-connects-to-different-ip-as-configured/125867/3 "2018-03-28T07:13:26Z")

</div>

Thanks I was so confused by this line that I didn't checked the credentials. I forgot that the username is case sensitive and that was the problem in the end.

---

<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:** [April 25, 2018, 7:13am UTC](https://discuss.elastic.co/t/jdbc-connects-to-different-ip-as-configured/125867/4 "2018-04-25T07:13:36Z")

</div>

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