# Error logstash.inputs.jdbc Unable to connect to database

**URL:** <https://discuss.elastic.co/t/error-logstash-inputs-jdbc-unable-to-connect-to-database/177091>\
**Category:** Logstash\
**Created:** [April 16, 2019, 12:45pm UTC](https://discuss.elastic.co/t/error-logstash-inputs-jdbc-unable-to-connect-to-database/177091 "2019-04-16T12:45:16Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![guyboertje](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/guyboertje/32/31592_2.png) [@guyboertje](https://discuss.elastic.co/u/guyboertje)\
**Post date:** [April 16, 2019, 4:06pm UTC](https://discuss.elastic.co/t/error-logstash-inputs-jdbc-unable-to-connect-to-database/177091/4 "2019-04-16T16:06:13Z")

</div>

What timezone are your timestamps recorded in in the MySQL DB?

If UTC then you can add some parameters to the jdbc connection string.

```auto
jdbc:mysql://localhost/mydb?useTimezone=true&useLegacyDatetimeCode=false&serverTimezone=UTC

```

---

_[View the full topic](https://discuss.elastic.co/t/error-logstash-inputs-jdbc-unable-to-connect-to-database/177091)._
