# Logstash mysql/mariadb jdbc connection error

**URL:** <https://discuss.elastic.co/t/logstash-mysql-mariadb-jdbc-connection-error/171709>\
**Category:** Logstash\
**Created:** [March 11, 2019, 9:24am UTC](https://discuss.elastic.co/t/logstash-mysql-mariadb-jdbc-connection-error/171709 "2019-03-11T09:24:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marcin\_Bartoszek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marcin_bartoszek/32/41758_2.png) [@Marcin\_Bartoszek](https://discuss.elastic.co/u/Marcin_Bartoszek)\
**Post date:** [March 11, 2019, 9:24am UTC](https://discuss.elastic.co/t/logstash-mysql-mariadb-jdbc-connection-error/171709/1 "2019-03-11T09:24:29Z")

</div>

Hi,

I'm struggling with connection to mariadb DB from logstash.  
Database is hosting on AWS.  
When connecting manualy there is no problem, but when using logstash I'm getting :

"[2019-03-11T09:17:00,029][ERROR][logstash.inputs.jdbc] Unable to connect to database. Tried 1 times {:error\_message=\>"Java::JavaSql::SQLRecoverableException: IO Error: Unknown host specified "}  
[2019-03-11T09:17:00,085][ERROR][logstash.inputs.jdbc] Unable to connect to database. Tried 1 times {:error\_message=\>"Java::JavaSql::SQLRecoverableException: IO Error: Unknown host specified "}  
[2019-03-11T09:17:00,314][ERROR][logstash.inputs.jdbc] Unable to connect to database. Tried 1 times {:error\_message=\>"Java::JavaSql::SQLException: Invalid Oracle URL specified"}  
"

Config:

input {  
jdbc {  
jdbc\_driver\_library =\> "/etc/logstash/ojdbc/mysql-connector-java-8.0.11.jar"  
jdbc\_driver\_class =\> "com.mysql.jdbc.Driver"  
jdbc\_connection\_string =\> "jdbc:mysql://rds...:[PORT]/test"  
jdbc\_user =\> "monitor"  
jdbc\_password =\> "monitor"  
schedule =\> "\*/1 \* \* \* \*"

```
statement => "SELECT * from test;"

 }

```

}  
}

Also tried with jdbc\_connection\_string =\> "jdbc:mysql: **thin:@** //rds...:[PORT]/dv\_saas", but nothing changed.

We have also Oracle db, and the problem doesn't exists:

"jdbc {  
jdbc\_driver\_library =\> "/etc/logstash/ojdbc/ojdbc8.jar"  
jdbc\_driver\_class =\> "Java::oracle.jdbc.driver.OracleDriver"  
jdbc\_connection\_string =\> "jdbc:oracle:thin:@chg0005267...:[PORT]/test"  
jdbc\_user =\> "test"  
jdbc\_password =\> "test"  
schedule =\> "\*/10 \* \* \* \*"  
...  
}"

Any idea why it happens ?

---

<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 8, 2019, 9:24am UTC](https://discuss.elastic.co/t/logstash-mysql-mariadb-jdbc-connection-error/171709/2 "2019-04-08T09:24:34Z")

</div>

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