# Jdbc connection to mariadb connection issue

**URL:** <https://discuss.elastic.co/t/jdbc-connection-to-mariadb-connection-issue/221404>\
**Category:** Logstash\
**Created:** [February 28, 2020, 10:40am UTC](https://discuss.elastic.co/t/jdbc-connection-to-mariadb-connection-issue/221404 "2020-02-28T10:40:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![annk](https://avatars.discourse-cdn.com/v4/letter/a/c68b51/32.png) [@annk](https://discuss.elastic.co/u/annk)\
**Post date:** [February 28, 2020, 10:40am UTC](https://discuss.elastic.co/t/jdbc-connection-to-mariadb-connection-issue/221404/1 "2020-02-28T10:40:00Z")

</div>

Hi,

I am using jdbc\_streaming filter plugin to connect to mariadb and pull data . I am getting the below error in logstash logs

[WARN][logstash.filters.jdbcstreaming] Exception when executing JDBC query {:exception=\>#\<Sequel::DatabaseDisconnectError: Java::JavaSql::SQLNonTransientConnectionException: (conn=165868) Broken pipe (Write failed)\>}

these are my connection parameters

```
        jdbc_user => "xxx"
        jdbc_password => "xxx"
        jdbc_driver_class => 'org.mariadb.jdbc.Driver'
        jdbc_driver_library => '/apps/logstash/mariadb-java-client-2.5.4.jar'
        jdbc_connection_string => "jdbc:mariadb://zzzz.com:3306/xxxxx"
        statement => "select device_name,sitetype,osversion,model,bldg from table where 
        device_name=:device"
        parameters => {"device" => "[hostname]"}
        target => "device_info"
        cache_expiration => 86400.0
        cache_size => 10000000
        use_cache => true
        tag_on_default_use => []
        jdbc_validate_connection => true

```

any other connection parameters I can use to fix the connection issue ?

---

<div class="post-metadata">

**Author:** ![ropc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ropc/32/47022_2.png) [@ropc](https://discuss.elastic.co/u/ropc)\
**Post date:** [March 1, 2020, 2:29am UTC](https://discuss.elastic.co/t/jdbc-connection-to-mariadb-connection-issue/221404/2 "2020-03-01T02:29:02Z")

</div>

@annk -

1. Was your Logstash pipeline working before?

2. Could you run Logstash with debug logging and send the debug logs to us? For example:

- `bin/logstash --debug -f <PATH_TO_CONFIG_FILE>`

Thank you.

---

<div class="post-metadata">

**Author:** ![annk](https://avatars.discourse-cdn.com/v4/letter/a/c68b51/32.png) [@annk](https://discuss.elastic.co/u/annk)\
**Post date:** [March 2, 2020, 11:57am UTC](https://discuss.elastic.co/t/jdbc-connection-to-mariadb-connection-issue/221404/3 "2020-03-02T11:57:13Z")

</div>

1. We recently started using mariadb, it was working fine with postgres.  
Currently restarting logstash fixes the issue, I thought enabling jdbc\_validate\_connection will fix the issue but it didnt.

2. I will try that

---

<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:** [March 30, 2020, 11:57am UTC](https://discuss.elastic.co/t/jdbc-connection-to-mariadb-connection-issue/221404/4 "2020-03-30T11:57:22Z")

</div>

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