# Dockerized MySQL

**URL:** https://discourse.nodered.org/t/dockerized-mysql/85465
**Category:** General
**Created:** [12 February 2024 20:04 UTC](https://discourse.nodered.org/t/dockerized-mysql/85465 "2024-02-12T20:04:56Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![humphrysr](https://avatars.discourse-cdn.com/v4/letter/h/4af34b/32.png) [@humphrysr](https://discourse.nodered.org/u/humphrysr)
#### Post date: [12 February 2024 20:04 UTC](https://discourse.nodered.org/t/dockerized-mysql/85465/1 "2024-02-12T20:04:57Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [12 February 2024 21:10 UTC](https://discourse.nodered.org/t/dockerized-mysql/85465/2 "2024-02-12T21:10:55Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [12 February 2024 21:39 UTC](https://discourse.nodered.org/t/dockerized-mysql/85465/3 "2024-02-12T21:39:11Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![humphrysr](https://avatars.discourse-cdn.com/v4/letter/h/4af34b/32.png) [@humphrysr](https://discourse.nodered.org/u/humphrysr)
#### Post date: [13 February 2024 14:26 UTC](https://discourse.nodered.org/t/dockerized-mysql/85465/4 "2024-02-13T14:26:25Z")

</div>

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???**

---

<div class="post-metadata">

### Author: ![humphrysr](https://avatars.discourse-cdn.com/v4/letter/h/4af34b/32.png) [@humphrysr](https://discourse.nodered.org/u/humphrysr)
#### Post date: [13 February 2024 15:18 UTC](https://discourse.nodered.org/t/dockerized-mysql/85465/5 "2024-02-13T15:18:26Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [13 February 2024 15:47 UTC](https://discourse.nodered.org/t/dockerized-mysql/85465/6 "2024-02-13T15:47:58Z")

</div>

> [@humphrysr](#):
>
> 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 🤷

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`

---

<div class="post-metadata">

### Author: ![humphrysr](https://avatars.discourse-cdn.com/v4/letter/h/4af34b/32.png) [@humphrysr](https://discourse.nodered.org/u/humphrysr)
#### Post date: [13 February 2024 16:57 UTC](https://discourse.nodered.org/t/dockerized-mysql/85465/7 "2024-02-13T16:57:36Z")

</div>

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".

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [13 February 2024 17:03 UTC](https://discourse.nodered.org/t/dockerized-mysql/85465/8 "2024-02-13T17:03:16Z")

</div>

> [@humphrysr](#):
>
> When I installed dbeaver to build a few table in MYSQL, localhost:3306 and I was done

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

> [@humphrysr](#):
>
> What does this mean, "IP addresses does the OS have".

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))

---

<div class="post-metadata">

### Author: ![humphrysr](https://avatars.discourse-cdn.com/v4/letter/h/4af34b/32.png) [@humphrysr](https://discourse.nodered.org/u/humphrysr)
#### Post date: [13 February 2024 18:34 UTC](https://discourse.nodered.org/t/dockerized-mysql/85465/9 "2024-02-13T18:34:40Z")

</div>

> [@Steve-Mcl](#):
>
> directly on the OS?

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

---

<div class="post-metadata">

### Author: ![joebordes](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/joebordes/32/86389_2.png) [@joebordes](https://discourse.nodered.org/u/joebordes)
#### Post date: [21 February 2024 23:48 UTC](https://discourse.nodered.org/t/dockerized-mysql/85465/10 "2024-02-21T23:48:35Z")

</div>

if it is an IP/network issue maybe [docker-hoster](https://github.com/dvddarias/docker-hoster) can help.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [21 May 2024 23:49 UTC](https://discourse.nodered.org/t/dockerized-mysql/85465/11 "2024-05-21T23:49:35Z")

</div>

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