title: How to connect with MySQL DB running as container in docker?
body: <p>Can some give me any idea about how to connect with my mysql db which is running as a container in Docker on a virtual machine?</p>
  
  <p>I have no idea about it, please help me.</p>
  
  <p>What I am trying to do is :- I am writing a java program on my local machine and now I want to establish a jdbc connection with mysql. My MySQL DB is running as a docker container on a Virtual machine. </p>
  
  <p>Does someone has any idea.</p>
  
  <p>Connection con = DriverManager.getConnection("jdbc:mysql://10.0.2.15/<strong>"what should I put here"</strong>,"root","myrootpassword");</p>
  
  <p>my ip address for the container is 172.17.0.2 and my guest ip is 10.0.2.15. My sql is running on port 3306.</p>
  
  <p>Thanks in Advance</p>