Dockerized MySQL

Although I can connect to the dockerized Mysql instance using a client, I can not get my local instance of node-red to connect ,using the mysql node. Suggestions?

Is you node-red also dockerised?

What IP does your mysql expose? Did you set that in the node? Can you ping that IP from node-red (tip use node-red-node-ping)

Did you expose the port for mysql in your docker instance?

or do you use docker compose ? as that should set up name resolution between containers for you - so you can reference the mysql server by name.

Is you node-red also dockerised? -- No

What IP does your mysql expose? - Used Docker INSPECT
Did you set that in the node? -- YES
Can you ping that IP from node-red (tip use node-red-node-ping). -- Will try that

Did you expose the port for mysql in your docker instance? -- How???

Ping fails.
"Gateway": "172.17.0.1",
"IPAddress": "172.17.0.4",. <<<<<<<<<<<<<<

Obviously, this is your issue - that goes without saying.

And this is a familiar problem for users dont know enough about docker and docker networking but insist on using it :person_shrugging:

I am one of those ^ people.

however, usually there is a routed network - what IP addresses does the OS have and if you log into the docker container, what does ip address reveal? I suspect there will be another IP that you can use - e.g. 172.28.225.136

I have the output from docker inspect mysql

When I installed dbeaver to build a few table in MYSQL, localhost:3306 and I was done.

Node red, not so easy ...

All of this running on a mac, docker, a bunch of containers, etc.

What does this mean, "IP addresses does the OS have".

Where was dbeaver installed? in the mySql container - or - directly on the OS?

OS = Operating System (i.e. the MacOS ie your computer i.e. NOT inside docker)
As in "what IP addresses does your computer (i.e. not docker, just your computer)"

Additional question, what version of NodeJs are you using?
(run node -v from your OS terminal (not inside docker))

dbeaver is in the OS. That was easy
Node-RED version: v3.1.5
Node.js version: v21.6.0
MAC ip address; 192.168.0.55

if it is an IP/network issue maybe docker-hoster can help.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.