title: Not able to connect from Spring Boot Docker Container to Local MySQL Database Server
body: <p>I am working on Windows 10 Environment.
  My Docker version 1.13.0, build 49bf474.</p>
  
  <p><strong>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.</strong></p>
  
  <blockquote>
    <p>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.</p>
  </blockquote>
  
  <p>Can somebody please help me to resolve this issue.</p>
  
  <p>Thanks in advance.</p>
  
  <p>Note : My Spring application configuration is fine as i am able to connect AWS MSQL RDS server from container without any issue.</p>
  
  <h3>The error I am receiving as below</h3>
  
  <pre><code>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.
  </code></pre>
  
  <h3>Few Information :</h3>
  
  <pre><code>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
  </code></pre>