Node-red mysql connection refused

Hi, team. i am running mysql server(127.0.0.1) 8.0 on my local windows machine. My node-red is running on a remote gateway (192.168.1.1) .
my windows 10 computer is connected to the gateway through a ethernet cable. so i can use node-red in my chrome by putting the address http://192.168.1.1:1880/#. so can the node-red connect to my local database running in my pc?
Error: connect ECONNREFUSED 127.0.0.1:3306

image
image

This is a loopback address. It essentially means "this computer". Since node-red is on a different device, it cannot access mysql on a your computer using that IP. You will need to provide the IP of your computer. You will also likely need to open that port number in the windows firewall.

thans for reply. so i have changed the config to my ip of my computer and opened port 3306 of my computer. new error occured
image
image

Please post text as text (pictures cannot easily be searched)

What node-red-xxx-yyy node have you installed? What version is that node?

What version of NodeJS and Node-RED are you using?

I think you need to configure MySQL to allow the correct authentication type ( but I’m not at computer so can’t recall the details

Node-RED version: v0.15.2
Node.js version: v4.7.0
i have installed Node-RED / MYSQL 0.0.19 (2019-10)
image

oh my. That is all super old and 100% out of support.

Node version 18 LTS is the lowest version in support.

Node-RED v3.1.7 is the current version.

node-red-node-mysql current version is 2.0.0

I am not certain we can help unless you upgrade everything to latest versions.

for your reference, i have downgraded my mysql server from 8.0 to 5.6, it works ok now! Thank you @Steve-Mcl @dceejay

That's a surprising choice of solution.

One alternative, if you can't update your remote gateway (whatever that means), would be to buy a $15 Raspberry Pi Zero Two W and install Node-red on that.
You would get up-to-date Node-red, node.js & npm and could use node-red-node-mysql v2.0.0 and up-to-date MySQL.

Or even a Pi 5 with Node-red and Mariadb (= mysql).

Cool, now everything in your entire stack is out of support and likely vulnerable to bugs and CVEs. At least you are consistent :rofl:

2 Likes