# How to do SSH key based authentication to MySQL in jdbc input plugin when using Logstash

**URL:** <https://discuss.elastic.co/t/how-to-do-ssh-key-based-authentication-to-mysql-in-jdbc-input-plugin-when-using-logstash/97190>\
**Category:** Logstash\
**Created:** [August 16, 2017, 6:37am UTC](https://discuss.elastic.co/t/how-to-do-ssh-key-based-authentication-to-mysql-in-jdbc-input-plugin-when-using-logstash/97190 "2017-08-16T06:37:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Deepti\_Jain](https://avatars.discourse-cdn.com/v4/letter/d/41988e/32.png) [@Deepti\_Jain](https://discuss.elastic.co/u/Deepti_Jain)\
**Post date:** [August 16, 2017, 6:37am UTC](https://discuss.elastic.co/t/how-to-do-ssh-key-based-authentication-to-mysql-in-jdbc-input-plugin-when-using-logstash/97190/1 "2017-08-16T06:37:13Z")

</div>

MYSQL DB server has been set up to accept an SSH key while authenticating the user. WHen the jdbc input plugin tries to connect to the server it fails to establish the connection since there is no means to provide the key. What is the workaround or solution to this problem. The intent of using logstash is to to ingest data from MySQL into ES.

Here is the input section in logstash config file:-1:  
jdbc {  
jdbc\_driver\_library =\> "C:\Deepti\mysql-connector-java-6.0.6\mysql-connector-java-6.0.6-bin.jar"  
jdbc\_driver\_class =\> "Java::com.mysql.cj.jdbc.Driver"  
jdbc\_connection\_string =\> "jdbc:mysql://35.200.116.45:3306/rapp\_product"  
jdbc\_user =\> "rapp\_admin"  
jdbc\_password =\> "Aspl@101(%$#"  
schedule =\> "\* \* \* \* \*"  
statement =\> "SELECT \* FROM m\_product\_detail INNER JOIN m\_product  
ON (m\_product\_detail.product\_id = m\_product.product\_id)  
WHERE m\_product.deleted\_flag = 0 && m\_product\_detail.deleted\_flag = 0 && m\_product.active\_flag = 1 && m\_product\_detail.active\_flag = 1"  
}

---

<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:** [September 13, 2017, 6:37am UTC](https://discuss.elastic.co/t/how-to-do-ssh-key-based-authentication-to-mysql-in-jdbc-input-plugin-when-using-logstash/97190/2 "2017-09-13T06:37:19Z")

</div>

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