Remote Docker MYSQL connect

Hello,

I have setup a remote docker deploy to my hosting server. The deploy works great, I see 2 docker containers on the host (web & MySQL). When I try to connect to the db in wappler I got an error that it cannot connect to the server.

All the incoming ports on the firewall are open. What am I missing here ?

Did you check mysql ports?

Where do you mean ?

sql

First line is my web container and second one is SQL server

Please read this article I hope it will help

“Create a MySQL Server with Docker” - Dale Nguyen https://link.medium.com/LV91ReI0z1

Hmm, do I need to create a user ? Normaly wappler has done this.

I am nor sure what you want me to check ?

Wappler indeed creates the MySQL user and database.

You should be able to connect remotely to the docker host ip that you have entered and the port specified with mySQL:

image

If you can’t connect maybe a firewall is stopping it?

Firewall ports are open (NAT)

When I telnet to the remote SQL container I got this:

Telnet%20SQL%20docker

This is my db config:

And when I click on “Test Connection” or “Save” I got following message:

Wappler%20db%20error

I’m having the exactly the same problem with wappler created docker containers. Wappler nor any other sql client can connect to database server.

Local SQL server installation or MAMP works just fine. Even tradionally hosted sql service works with Wappler. But these wappler docker containers refuse any connections to SQL server.

I’m not too familiar with docker but it seems that server is refusing remote connections to sql server. Necessary ports are open on server and local but still connection is refused by container.

Any ideas where to start debugging this?

Mmm, ok.

I rebooted DO Droplet and now remote connection works.

I still can’t get local docker container to work. I booted my mac and brought everything back up (Docker Desktop and containers) but still I can’t connect local sql.

On a containers start it takes a bit for the MySQL server to start (1-2 mins) so in that time you get such message.