I am working on Windows 10 Environment. My Docker version 1.13.0, build 49bf474.
I have a Spring Boot application running on Docker container I am trying to access local instance of MySQL from Spring Application. My instance of MYSQL is not running on container.
I understand this is a networking issue and already try to run docker using following command : docker run -p 8282:8191 ami --network="host" but no success.
Can somebody please help me to resolve this issue.
Thanks in advance.
Note : My Spring application configuration is fine as i am able to connect AWS MSQL RDS server from container without any issue.
The error I am receiving as below
2019-04-19 07:33:32.025 INFO 1 --- [ main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 3308 ms
2019-04-19 07:33:32.264 INFO 1 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2019-04-19 07:33:33.422 ERROR 1 --- [ main] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Exception during pool initialization.
com.mysql.cj.jdbc.exceptions.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.
Few Information :
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/financedb
spring.datasource.username=****
spring.datasource.password=****
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver