# Facing communication issue while sending data from SQL to logstash

**URL:** <https://discuss.elastic.co/t/facing-communication-issue-while-sending-data-from-sql-to-logstash/315269>\
**Category:** Logstash\
**Created:** [September 27, 2022, 2:08pm UTC](https://discuss.elastic.co/t/facing-communication-issue-while-sending-data-from-sql-to-logstash/315269 "2022-09-27T14:08:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bhanuji\_paluri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bhanuji_paluri/32/101841_2.png) [@Bhanuji\_paluri](https://discuss.elastic.co/u/Bhanuji_paluri)\
**Post date:** [September 27, 2022, 2:08pm UTC](https://discuss.elastic.co/t/facing-communication-issue-while-sending-data-from-sql-to-logstash/315269/1 "2022-09-27T14:08:41Z")

</div>

find the logs from logstash side.

[2022-09-27T15:47:00,258][ERROR][logstash.inputs.jdbc][test][f4db26278744478bf3c5e76b57171244092a989c2d32ce74f9029d5a6e668706] Unable to connect to database. Tried 1 times {:error\_message=\>"Java::ComMysqlCjJdbcExceptions::CommunicationsException: Communications link failure\n\nThe last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server."}  
{ 2960 rufus-scheduler intercepted an error:  
2960 job:  
2960 Rufus::Scheduler::CronJob "\*/5 \* \* \* \* \*" {}  
2960 error:  
2960 2960  
2960 Sequel::DatabaseConnectionError  
2960 Java::ComMysqlCjJdbcExceptions::CommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.  
2960 com.mysql.cj.jdbc.exceptions.SQLError.createCommunicationsException(com/mysql/cj/jdbc/exceptions/SQLError.java:174)  
2960 com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(com/mysql/cj/jdbc/exceptions/SQLExceptionsMapping.java:64)  
2960 com.mysql.cj.jdbc.ConnectionImpl.createNewIO(com/mysql/cj/jdbc/ConnectionImpl.java:835)  
2960 com.mysql.cj.jdbc.ConnectionImpl.(com/mysql/cj/jdbc/ConnectionImpl.java:455)  
2960 com.mysql.cj.jdbc.ConnectionImpl.getInstance(com/mysql/cj/jdbc/ConnectionImpl.java:240)  
2960 com.mysql.cj.jdbc.NonRegisteringDriver.connect(com/mysql/cj/jdbc/NonRegisteringDriver.java:199)  
2960 jdk.internal.reflect.GeneratedMethodAccessor30.invoke(jdk/internal/reflect/GeneratedMethodAccessor30)  
2960 jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(jdk/internal/reflect/DelegatingMethodAccessorImpl.java:43)  
2960 java.lang.reflect.Method.invoke(java/lang/reflect/Method.java:566)  
2960 org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(org/jruby/javasupport/JavaMethod.java:471)  
2960 org.jruby.javasupport.JavaMethod.invokeDirect(org/jruby/javasupport/JavaMethod.java:329)  
2960 u01.ELK.$7\_dot\_10\_dot\_2.LS.vendor.bundle.jruby.$2\_dot\_5\_dot\_0.gems.sequel\_minus\_5\_dot\_38\_dot\_0.lib.sequel.adapters.jdbc.connect(/u01/ELK/7.10.2/LS/vendor/bundle/jruby/2.5.0/gems/sequel-5.38.0/lib/sequel/adapters/jdbc.rb:239)

===========config file in logstash.====

i have successfully connected SQL data base from logstash server in teriminal.

input {  
jdbc {  
jdbc\_driver\_library =\> "/usr/share/java/mysql-connector-java.jar"  
jdbc\_driver\_class =\> "com.mysql.jdbc.Driver"  
jdbc\_connection\_string =\> "jdbc:mysql://iposdb-mysql-74.sero.gic..se/iposDB"  
jdbc\_user =\> "XXXX"  
jdbc\_password =\> "XXXXXXX"  
jdbc\_paging\_enabled =\> true  
tracking\_column =\> "unix\_ts\_in\_secs"  
tracking\_column\_type =\> "numeric"  
schedule =\> "\*/5 \* \* \* \* \*"  
statement =\> "SELECT \* FROM stagingScriptDB"  
}  
}  
output {  
file {  
path =\> "/proj/toolsr6k/logstash/scripts\_data.txt"}  
}

---

<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:** [October 25, 2022, 2:08pm UTC](https://discuss.elastic.co/t/facing-communication-issue-while-sending-data-from-sql-to-logstash/315269/2 "2022-10-25T14:08:49Z")

</div>

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