Skip to main content
Question

While establishing JDBC connection.

  • September 1, 2022
  • 12 replies
  • 121 views

Akanksha
Fan

I am getting this type of error JDBC_00 - Cannot connect to specified database: com.mysql.cj.jdbc.exceptions.CommunicationsException. Can anybody help me in this.

 

12 replies

alex.sanchez
StreamSets Employee
Forum|alt.badge.img
  • StreamSets Employee
  • September 1, 2022

Hi @Akanksha,

This is an exception coming from MySQL driver, basically we are not able to establish the connection.

Quickly googling it, I’ve found this that might help you troubleshoot https://stackoverflow.com/questions/6865538/solving-a-communications-link-failure-with-jdbc-and-mysql


Akanksha
Fan
  • Author
  • Fan
  • September 1, 2022

Actually, I tried everything but than also not able to establish connection. So could you please tell me, is there any other way to establish a JDBC connection.


alex.sanchez
StreamSets Employee
Forum|alt.badge.img
  • StreamSets Employee
  • September 1, 2022

Have you tried doing a ping to the machine where the MySQL is located? Are we sure it is reachable? (Not blocked by a firewall or things like that)


Akanksha
Fan
  • Author
  • Fan
  • September 2, 2022

Its Resolved automatically. Thanks for helping @alex.sanchez .


JoeMeszaros
Fan
  • Fan
  • October 19, 2022

Hello @alex.sanchez ,

I am actually experiencing the same issue. I was wondering if @Akanksha had shared what solved this issue? I have a server set up locally that I need to connect to yet I am receiving this error. I’m working off a Mac. I’ve also downloaded the MySQL driver and have added it as a external resource but I’m still until able to connect. I’ve also checked that my firewall is open. Any other suggestions to resolve this?? 
 

Thanks in advance!


saleempothiwala
Headliner
Forum|alt.badge.img

@JoeMeszaros 

Make sure your data collector has access to the database.


JoeMeszaros
Fan
  • Fan
  • October 19, 2022

Hi @saleempothiwala ,

Is there a specific place I should be checking to make sure of that? 

Thank you! 


saleempothiwala
Headliner
Forum|alt.badge.img

@JoeMeszaros are you using docker for SDC?

If yes, then make sure your sdc docker is in the same docker network as your database.
you can validate it by docker exec into your instance and do a ping to the database.


JoeMeszaros
Fan
  • Fan
  • October 19, 2022

@saleempothiwala got it! Let me give that a try. 


saleempothiwala
Headliner
Forum|alt.badge.img

cool. Let me know how it goes :-)


JoeMeszaros
Fan
  • Fan
  • October 19, 2022

Hi @saleempothiwala 

It seems as though both the SDC and mysqldb are on the same network but I’m still getting the same error.

 


Bikram
Headliner
Forum|alt.badge.img+1
  • Headliner
  • October 19, 2022

@Akanksha 

can you please give a try with below jdbc connection string.

 

jdbc:mysql://[//mysqldb:3306/zomato?enabledTLSProtocols=TLSv1.2