# Trying to access a remote MySQL database

**URL:** <https://discourse.nodered.org/t/trying-to-access-a-remote-mysql-database/17058>\
**Category:** General\
**Created:** [23 October 2019 17:55 UTC](https://discourse.nodered.org/t/trying-to-access-a-remote-mysql-database/17058 "2019-10-23T17:55:54Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [23 October 2019 17:55 UTC](https://discourse.nodered.org/t/trying-to-access-a-remote-mysql-database/17058/1 "2019-10-23T17:55:54Z")

</div>

I'm trying to set-up access (for my IoT students) to a remote MySQL database that has been recording readings from our weather station.  
I've written the NR flow and got everything working from my home using node-red-node-mysql.  
Everything works fine - database updates and I can access it fine.  
Also my friend in the USA can access the database just fine as well.

The problem comes when I try to do this via the school's network.  
I can ping the MySQL server from the IT Room, so this sort of indicates there is a route to the server.  
I've entered the various IP addresses into the Remote MySQL settings with my ISP to grant remote access.

I'm sure this is a networking problem with the school's network, but as I'm not familar with the intricacies of corporate networking I'm at a bit of a loss as to what to try next.  
The error message I get in a debug node (at school) is "Error: Pool is closed" and "Database is not connected".

Any suggestions as to what I could check or try, would be appreciated.

---

<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:** [23 October 2019 18:09 UTC](https://discourse.nodered.org/t/trying-to-access-a-remote-mysql-database/17058/2 "2019-10-23T18:09:37Z")

</div>

Is the port on the server accessible via your network. I think it’s 3306 by default. Maybe a tool like nmap will help test it end to end

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [23 October 2019 18:12 UTC](https://discourse.nodered.org/t/trying-to-access-a-remote-mysql-database/17058/3 "2019-10-23T18:12:11Z")

</div>

Thanks Dave - yes it is port-3306.  
I'll ask the IT people to check it.

---

<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:** [23 October 2019 18:14 UTC](https://discourse.nodered.org/t/trying-to-access-a-remote-mysql-database/17058/4 "2019-10-23T18:14:26Z")

</div>

nmap -p 3306 ip-of-server

Should do it from your client end

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [23 October 2019 18:17 UTC](https://discourse.nodered.org/t/trying-to-access-a-remote-mysql-database/17058/5 "2019-10-23T18:17:27Z")

</div>

Thanks Dave - when I said the IT people, I meant the IT people at the school.

I've just run the 'nmap' command on one of my RPi(es) and can see what the results look like - thanks.

---

<div class="post-metadata">

**Author:** ![sahar](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sahar/32/86660_2.png) [@sahar](https://discourse.nodered.org/u/sahar)\
**Post date:** [22 January 2023 07:00 UTC](https://discourse.nodered.org/t/trying-to-access-a-remote-mysql-database/17058/6 "2023-01-22T07:00:04Z")

</div>

I try to config mysql node to connect my database which located at remote host ,but it doesn't connect. may i have your project flow ,for checking my nodes configurations ?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [22 January 2023 07:45 UTC](https://discourse.nodered.org/t/trying-to-access-a-remote-mysql-database/17058/7 "2023-01-22T07:45:03Z")

</div>

You have replied to a very old thread. A lot has changed since then. Please start a new thread and give us a lot more information about your problem. What versions of node red and nodejs are you using? What OS? What error are you seeing? Also, can you access the database from the machine running node red using something like the mysql command line client?

I will close this thread.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [22 January 2023 07:45 UTC](https://discourse.nodered.org/t/trying-to-access-a-remote-mysql-database/17058/8 "2023-01-22T07:45:48Z")

</div>


