Closed biladina closed 10 months ago
Hi @biladina This is because it is impossible since the phpmyadmin container is not on your host but in it's own network. So 127.0.0.1 is it's own localhost.
The best to make it work would be to use network_mode: host
and if the port 80 is already used, choose another one
https://github.com/phpmyadmin/docker/blob/master/testing/docker-compose/docker-compose.testing-different-apache-port.yml#L29
okay, thank you very much..
I can't use network_mode: host
because I use NGINX Proxy.. but I can solve my problem by change LocalForward
from my jumphost configuration to use docker own IP address..
if anyone have same problem with jumphost connection..
172.18.0.1
Localforward 172.18.0.1:8001 127.0.0.1:3306
then you can access your local forward database at IP 172.18.0.1
and port 8001
Thank you for this interesting tip ! If I understand correctly you use ssh on the workstation to forward the MySQL connection into the container ?
One other way would be to forward the socket file with a Docker volume: https://github.com/phpmyadmin/docker/blob/272944cc5a10f7740acacbe2a35c2c1f6d9a98c7/testing/docker-compose/docker-compose.testing-one-socket-host.yml#L27
Thank you for this interesting tip ! If I understand correctly you use ssh on the workstation to forward the MySQL connection into the container ?
yes, exactly..
One other way would be to forward the socket file with a Docker volume:
okay, I will try this one.. thank you..
Problem:
I have database connection from jumphost that forward to my local machine with custom port, so in the end it is local db connection with custom port.. the problem is, I can't login to the database from phpmyadmin, it says connection refused,
I can login to mysql via console with command ![Screenshot_20230922_170702](https://github.com/phpmyadmin/docker/assets/10651085/34b0f2d7-8dbe-40af-9037-fa9abf52075e)
mysqli::real_connect(): (HY000/2002): Connection refused
mysql -h 127.0.0.1 -P 8001 -u root -p
, and also try login with app like DBeaver, it works, but can't login with phpmyadminExpected result:
can login and access the database
Environment:
host: 127.0.0.1 port: 8001 MySQL version: 8.0.34
docker-compose.yml
variables.env