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?
I have no idea about it, please help me.
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.
Does someone has any idea.
Connection con = DriverManager.getConnection("jdbc:mysql://10.0.2.15/"what should I put here","root","myrootpassword");
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.
Thanks in Advance