Docker phpmyadmin access to mysql host8/11/2023 ![]() Setting the tunnel listener to listen on 0.0.0.0:3306 will solve this problem but also will allow others on the network to connect to the forwarded database. The 127.0.0.1:3306 setting binds to the host's localhost interface, but at least on native Linux the request will actually arrive from the docker0 interface. You might need to change the settings of the ssh tunnel listener for this to work. For this you don't need any special networks: or network_mode: option at all. ![]() ![]() In particular, if you're on a MacOS or Windows host, host networking just doesn't work (you connect to the "host network" of a hidden Linux VM) and you'll need to use the special host name instead of localhost. You may be able to use a different approach to connect to the ssh tunnel also see From inside of a Docker container, how do I connect to the localhost of the machine?. The configuration you have creates a Compose network that happens to be named host, but it's not "the host network". You need to change your service configuration to say services: Configuring the MySQL Docker container to support multiple databases and multiple user IDs starts with the configuration of a single database and single user. Which means mysql user in not allowed to access from given ip address (in this case my public ip) and i guess that's because docker container is not using ssh tunneling from my local machine even if i'm using host network (which again i'm not sure what it actually does).Īnyone got any ideas what i'm doing wrong? Answers $cfg = 24*60*60*30 Īfter i choose remote-server-name in server choice i get the following message mysqli::real_connect(): (HY000/2002): Connection refused Server choice configuration for PhpMyAdmin () $cfg = 'remote-server-name' Since i'm using host network, docker container should be aware of local port forwarding (not really sure about this tho, but i couldn't find much information online on how host network actually works).Īfter i do ssh to remote server there should be a tunnel on my local machine on port 3306 that is pointing to 3306 on remote server. usr/local/etc/php/php.ini:/php-make/upload.ini On remote server i'm using mysql user who can only access from localhost which is why i need ssh tunneling. I am running PhpMyAdmin using Docker on my local machine with docker-compose. 2 days ago &0183 &32 Use mysql://db:3306 as host in my dart code Log into my mysql container from my local machine (works perfectly, so the issue is the connection between dart server and mysql server) I tried a lot of things I dont recall, as I spent 2 days tweaking around to make this work.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |