Connect phpMyAdmin docker image to the HOST MySQL server listening only on 127.0.0.1 Connect phpMyAdmin docker image to the HOST MySQL server listening only on 127.0.0.1 docker docker

Connect phpMyAdmin docker image to the HOST MySQL server listening only on 127.0.0.1


You shouldn't use 127.0.0.1 as IP address to refer to the host as that will point to the docker container where phpAdmin is running.

You need to find the IP address of the host on the docker0 interface as use that ip instead. You can do that using:

-e PMA_HOST=$(ip route show | grep docker0 | awk '{print $9}')


If your mysql is on your host, without a domain name, you won't be able to access it from a container. Maybe with a bridged network. You should try to move the database to a container. It will be super easy to connect the phpmyadmin then.