Docker Community Forums

Share and learn in the Docker community.

Unable to connect MySQL running on localhost from docker image


(Shailendra Singh) #1

Finally, if your issue has not been addressed elsewhere, running:

  • :whale: :arrow_right:️ Settings :arrow_right:️ Diagnose & Feedback :arrow_right:️ Open Issues.

Dear Team,

I am new in Docker area and trying to explore this. I am not understanding what wrong I am doing or I am not following correct steps to resolve issue:

I have developed a Microservice which connects to my local MySQL, it is working fine. Again I created docker image of that Microservice and trying to run this image through docker. While I am running this docker image, its giving exception saying not able to initialize this connection with MySQL.

Docker is running on Window10 laptop. Below is connection details which works fine, if Microservice is being executed in local machine. When I am trying to run docker image of same microservice in docker environment it is throwing issue as said above.

spring.datasource.tomcat.min-idle=15 = org.hibernate.dialect.MySQLDialect = false = true

(Dockerprofessor) #2

How did you solve this Singh?

Best Regards