Error: connect ECONNREFUSED while connecting to MYSQL


I am using IOT 2040 connect with energy meter running in node-red server it's perfectly working but I want to pass this data to local server MYSQL
Give me a solution please

You need to connect to the database. Are you really running MYSQL on an IOT2040 device?

See https://stackoverflow.com/questions/7864276/cannot-connect-to-database-server-mysql-workbench for some problem solving steps.

I've seen that error in the past.
In my case I was trying to access a remote MySQL dB (not a local one).
I ended-up having to enter my external IP in my ISP's 'grant remote access' setting in the cPanel.

is NR running on the same macine as MySQL? By setting the IP to 127.0.0.1 (which is the local loopback) that tells NR to attempt to connect to MySQL on the same machine.

Try putting in the IP of the machine running MySQL and see what happens.

Connect to database

Can you share what you did to get it to connect to the dB???