In this article, we will explain the different ways through which you can access the MySQL running on your localhost or any other program in your host machine from the container. Hence, we can conclude that MySQL is bound to be run on localhost only and not accessible to the outside world because it is not bound on the IP address. Also, the MySQL is running on your localhost and the host machine does not expose any port to the outside world. Now, you want to access the MySQL server in your host machine from the Nginx container. And you have a MySQL database running in your host machine. Suppose you have an Nginx web server running inside an Nginx container in your host machine.