So I have a web container, and a SQL container that belongs to it. Yet, when I attempt to use the connection info of the sql container (including its own IP address) into the web container, I can’t seem to connect to it. Even if ip bind address is 0.0.0.0
Any idea how I can make this work? Firewall is disabled, so that’s not it.
Using LXC 4.1, Ubuntu 18.04 minimal. Both containers are on the same system, default lxdbr0 name in bridged mode (eth0). And only using nginx proxy (which I still fail to properly set-up).
And it means that I’m trying to make WEB container (forums) to connect to the MYSQL container. But it appears that it cannot make the connection to the mysql container, as it seems to be rejecting it.
I have changed things and made the web/forum files into a single container so that’s sorted. But I’d still like to know how to make a remote connection to the sql container database from outside the container.
From the looks of the logs, connection refused. While I can ping the containers just fine with each other. An example of another container with a php mysql remote application attempting to connect to the database container:
Not sure why it is refusing though. (even if I add 3306 at the end). SQL bind is set to 0.0.0.0, and its set locally on the same machine.
Last time I used the host name, it didn’t resolve so I switched to IP instead. I’ll see if I can use the host tomorrow. As for the value, I changed it in either /etc/mysql/my.cnf or mariadb.cnf / conf.
Currently in bed, so I don’t recall which one of the two it was. It was set to 127.0.0.1 before I changed it, and ya. I rebooted mysql.