Trouble conecting RulesEngine to MySql

Hello everyone.
I am working on a project for my company, and am publishing downtimes from machines to a dashboard hosted in node red(particle RulesEngine). This works so far.
I also created a MySql database, but the problem is it does not connect. I get this error log: “Error: connect ECONNREFUSED 127.0.0.1:3306”.
I am Running the database on localhost.

Any suggestions why this could be happening?


this is my flow

Connection refused indicates MySQL is not started, is not listening on 127.0.0.1, or a host-based firewall is blocking the connection. Not a nodeRed issue.

Thank you very much!

I would try to connect to the MySql from the command line or from MySql workbench to validate its up.

1 Like

I tried using the workbench, and was succesfull to connect to the server, but not with the rules engine.

Is rules engine running on the same host as mysql?

Hi @picsil, thanks for your reply. How can I make sure that both are running on the same host? In case they aren´t, how do I handle this issue?

I was asking if both applications are installed on the same machine because you’re using IP address 127.0.0.1, which is only accessible on the local machine. 127.0.0.1 is the loopback address, which connects back to itself. Works fine for applications installed on one machine, but if your rules engine is on another machine, you’ll need to use the real IP of your mysql host, not 127.0.0.1.

1 Like

Yes, for testing purposes I am running both instances on the same machine.

What OS are you running on the server? Can you show the output of the following commands?

Linux:

netstat -anp

Mac or Windows:

netstat -an

I’m with you. I was also wondering about the output of

netstat -na | grep 3306

Just to be a 100%. You mention mSQL and the rules engine on the same machine:

But you also specifically refer to it as the Particle Rules Engine.

Are you using the Particle hosted non-public Rules engine, or are you using a self-hosted version of node-red with community nodes for Particle functionality?

@Moors7 To be honest, I am not sure, my company has a contract with Particle, and they set up the devices and gave us the accounts. I would have to ask.

@picsil This is the Ouput of the command ( I am using Windows 10):

Aktive Verbindungen

Proto Lokale Adresse Remoteadresse Status
TCP 0.0.0.0:135 0.0.0.0:0 ABHÖREN
TCP 0.0.0.0:445 0.0.0.0:0 ABHÖREN
TCP 0.0.0.0:3389 0.0.0.0:0 ABHÖREN
TCP 0.0.0.0:4343 0.0.0.0:0 ABHÖREN
TCP 0.0.0.0:5357 0.0.0.0:0 ABHÖREN
TCP 0.0.0.0:8081 0.0.0.0:0 ABHÖREN
TCP 0.0.0.0:9535 0.0.0.0:0 ABHÖREN
TCP 0.0.0.0:9593 0.0.0.0:0 ABHÖREN
TCP 0.0.0.0:9594 0.0.0.0:0 ABHÖREN
TCP 0.0.0.0:9595 0.0.0.0:0 ABHÖREN
TCP 0.0.0.0:9999 0.0.0.0:0 ABHÖREN
TCP 0.0.0.0:33354 0.0.0.0:0 ABHÖREN
TCP 0.0.0.0:47546 0.0.0.0:0 ABHÖREN
TCP 0.0.0.0:49664 0.0.0.0:0 ABHÖREN
TCP 0.0.0.0:49665 0.0.0.0:0 ABHÖREN
TCP 0.0.0.0:49666 0.0.0.0:0 ABHÖREN
TCP 0.0.0.0:49667 0.0.0.0:0 ABHÖREN
TCP 0.0.0.0:49668 0.0.0.0:0 ABHÖREN
TCP 0.0.0.0:49670 0.0.0.0:0 ABHÖREN
TCP 0.0.0.0:49673 0.0.0.0:0 ABHÖREN
TCP 0.0.0.0:49675 0.0.0.0:0 ABHÖREN
TCP 0.0.0.0:49706 0.0.0.0:0 ABHÖREN
TCP 10.226.142.55:139 0.0.0.0:0 ABHÖREN
TCP 10.226.142.55:51960 199.19.250.205:80 HERGESTELLT
TCP 10.226.142.55:52001 199.19.250.205:80 FIN_WARTEN_2
TCP 10.226.142.55:52078 199.19.250.205:80 FIN_WARTEN_2
TCP 10.226.142.55:64221 10.179.140.252:445 HERGESTELLT
TCP 10.226.142.55:64242 199.19.250.205:80 HERGESTELLT
TCP 10.226.142.55:64275 52.112.194.49:443 HERGESTELLT
TCP 10.226.142.55:64323 10.200.200.133:445 HERGESTELLT
TCP 10.226.142.55:64328 10.200.231.79:445 HERGESTELLT
TCP 10.226.142.55:64435 199.19.250.205:80 HERGESTELLT
TCP 10.226.142.55:64449 199.19.250.205:80 HERGESTELLT
TCP 10.226.142.55:64463 199.19.250.205:80 HERGESTELLT
TCP 10.226.142.55:64465 199.19.250.205:80 HERGESTELLT
TCP 10.226.142.55:64481 199.19.250.205:80 HERGESTELLT
TCP 10.226.142.55:64699 199.19.250.205:80 SCHLIESSEN_WARTEN
TCP 10.226.142.55:64700 199.19.250.205:80 HERGESTELLT
TCP 10.226.142.55:64702 199.19.250.205:80 WARTEND
TCP 10.226.142.55:64715 199.19.250.205:80 HERGESTELLT
TCP 10.226.142.55:64721 199.19.250.205:80 HERGESTELLT
TCP 10.226.142.55:64722 199.19.250.205:80 HERGESTELLT
TCP 10.226.142.55:64724 199.19.250.205:80 HERGESTELLT
TCP 10.226.142.55:64725 199.19.250.205:80 HERGESTELLT
TCP 10.226.142.55:64731 199.19.250.205:80 HERGESTELLT
TCP 10.226.142.55:64755 199.19.250.205:80 HERGESTELLT
TCP 10.226.142.55:64756 199.19.250.205:80 HERGESTELLT
TCP 10.226.142.55:64759 199.19.250.205:80 HERGESTELLT
TCP 10.226.142.55:64762 199.19.250.205:80 WARTEND
TCP 10.226.142.55:64784 199.19.250.205:80 WARTEND
TCP 10.226.142.55:64798 10.179.168.123:443 HERGESTELLT
TCP 10.226.142.55:64824 199.19.250.205:80 WARTEND
TCP 10.226.142.55:64827 199.19.250.205:80 HERGESTELLT
TCP 10.226.142.55:64830 199.19.250.205:80 HERGESTELLT
TCP 10.226.142.55:64833 199.19.250.205:80 WARTEND
TCP 10.226.142.55:64836 199.19.250.205:80 WARTEND
TCP 10.226.142.55:64841 199.19.250.205:80 WARTEND
TCP 10.226.142.55:64843 199.19.250.205:80 HERGESTELLT
TCP 10.226.142.55:64844 199.19.250.205:80 WARTEND
TCP 10.226.142.55:64845 199.19.250.205:80 WARTEND
TCP 10.226.142.55:64846 199.19.250.205:80 WARTEND
TCP 10.226.142.55:64848 199.19.250.205:80 HERGESTELLT
TCP 10.226.142.55:64849 199.19.250.205:80 WARTEND
TCP 10.226.142.55:64851 199.19.250.205:80 WARTEND
TCP 10.226.142.55:64868 199.19.250.205:80 WARTEND
TCP 10.226.142.55:64869 199.19.250.205:80 HERGESTELLT
TCP 10.226.142.55:64874 10.179.168.123:443 WARTEND
TCP 10.226.142.55:64875 199.19.250.205:80 HERGESTELLT
TCP 10.226.142.55:64878 10.179.168.123:443 WARTEND
TCP 10.226.142.55:64880 199.19.250.205:80 HERGESTELLT
TCP 10.226.142.55:64881 199.19.250.205:80 HERGESTELLT
TCP 10.226.142.55:64882 199.19.250.205:80 HERGESTELLT
TCP 10.226.142.55:64883 199.19.250.205:80 HERGESTELLT
TCP 10.226.142.55:64885 199.19.250.205:80 HERGESTELLT
TCP 10.226.142.55:64887 52.139.250.253:443 SYN_GESENDET
TCP 10.226.142.55:64888 64.233.189.108:993 SYN_GESENDET
TCP 10.226.142.55:64889 52.229.171.202:443 SYN_GESENDET
TCP 10.226.142.55:64890 199.19.250.205:80 HERGESTELLT
TCP 10.226.142.55:64891 199.19.250.205:80 HERGESTELLT
TCP 10.226.142.55:64892 199.19.250.205:80 HERGESTELLT
TCP 127.0.0.1:9535 127.0.0.1:63422 HERGESTELLT
TCP 127.0.0.1:9592 0.0.0.0:0 ABHÖREN
TCP 127.0.0.1:9592 127.0.0.1:64797 HERGESTELLT
TCP 127.0.0.1:9595 127.0.0.1:64828 WARTEND
TCP 127.0.0.1:21584 0.0.0.0:0 ABHÖREN
TCP 127.0.0.1:21584 127.0.0.1:64858 WARTEND
TCP 127.0.0.1:21584 127.0.0.1:64860 WARTEND
TCP 127.0.0.1:21584 127.0.0.1:64862 WARTEND
TCP 127.0.0.1:21584 127.0.0.1:64864 WARTEND
TCP 127.0.0.1:21584 127.0.0.1:64866 WARTEND
TCP 127.0.0.1:27017 0.0.0.0:0 ABHÖREN
TCP 127.0.0.1:49671 0.0.0.0:0 ABHÖREN
TCP 127.0.0.1:49671 127.0.0.1:49674 HERGESTELLT
TCP 127.0.0.1:49674 127.0.0.1:49671 HERGESTELLT
TCP 127.0.0.1:49704 0.0.0.0:0 ABHÖREN
TCP 127.0.0.1:51205 127.0.0.1:64863 WARTEND
TCP 127.0.0.1:51207 127.0.0.1:64867 WARTEND
TCP 127.0.0.1:51214 127.0.0.1:64865 WARTEND
TCP 127.0.0.1:51235 127.0.0.1:64856 WARTEND
TCP 127.0.0.1:62522 0.0.0.0:0 ABHÖREN
TCP 127.0.0.1:63422 127.0.0.1:9535 HERGESTELLT
TCP 127.0.0.1:64797 127.0.0.1:9592 HERGESTELLT
TCP 127.0.0.1:64857 127.0.0.1:21584 WARTEND
TCP 127.0.0.1:64870 127.0.0.1:9592 WARTEND
TCP 127.0.0.1:64877 127.0.0.1:9592 WARTEND
TCP 192.168.18.1:139 0.0.0.0:0 ABHÖREN
TCP 192.168.22.1:139 0.0.0.0:0 ABHÖREN
TCP [::]:135 [::]:0 ABHÖREN
TCP [::]:445 [::]:0 ABHÖREN
TCP [::]:3389 [::]:0 ABHÖREN
TCP [::]:5357 [::]:0 ABHÖREN
TCP [::]:8081 [::]:0 ABHÖREN
TCP [::]:9535 [::]:0 ABHÖREN
TCP [::]:9593 [::]:0 ABHÖREN
TCP [::]:9594 [::]:0 ABHÖREN
TCP [::]:9595 [::]:0 ABHÖREN
TCP [::]:9999 [::]:0 ABHÖREN
TCP [::]:47546 [::]:0 ABHÖREN
TCP [::]:49664 [::]:0 ABHÖREN
TCP [::]:49665 [::]:0 ABHÖREN
TCP [::]:49666 [::]:0 ABHÖREN
TCP [::]:49667 [::]:0 ABHÖREN
TCP [::]:49668 [::]:0 ABHÖREN
TCP [::]:49670 [::]:0 ABHÖREN
TCP [::]:49673 [::]:0 ABHÖREN
TCP [::]:49675 [::]:0 ABHÖREN
TCP [::]:49706 [::]:0 ABHÖREN
TCP [::1]:7821 [::]:0 ABHÖREN
UDP 0.0.0.0:123 :
UDP 0.0.0.0:500 :
UDP 0.0.0.0:3389 :
UDP 0.0.0.0:3702 :
UDP 0.0.0.0:3702 :
UDP 0.0.0.0:4500 :
UDP 0.0.0.0:5050 :
UDP 0.0.0.0:5353 :
UDP 0.0.0.0:5353 :
UDP 0.0.0.0:5353 :
UDP 0.0.0.0:5353 :
UDP 0.0.0.0:5355 :
UDP 0.0.0.0:9595 :
UDP 0.0.0.0:33354 :
UDP 0.0.0.0:33355 :
UDP 0.0.0.0:38293 :
UDP 0.0.0.0:49544 :
UDP 0.0.0.0:52787 :
UDP 10.226.142.55:137 :
UDP 10.226.142.55:138 :
UDP 10.226.142.55:1900 :
UDP 10.226.142.55:57548 :
UDP 10.226.142.55:63950 :
UDP 127.0.0.1:1900 :
UDP 127.0.0.1:50112 :
UDP 127.0.0.1:53655 :
UDP 127.0.0.1:57061 :
UDP 127.0.0.1:57549 :
UDP 127.0.0.1:60335 :
UDP 127.0.0.1:61765 :
UDP 127.0.0.1:62309 :
UDP 192.168.18.1:137 :
UDP 192.168.18.1:138 :
UDP 192.168.18.1:1900 :
UDP 192.168.18.1:49512 :
UDP 192.168.18.1:57546 :
UDP 192.168.22.1:137 :
UDP 192.168.22.1:138 :
UDP 192.168.22.1:1900 :
UDP 192.168.22.1:57547 :
UDP 192.168.22.1:60418 :
UDP [::]:123 :
UDP [::]:500 :
UDP [::]:3389 :
UDP [::]:3702 :
UDP [::]:3702 :
UDP [::]:4500 :
UDP [::]:49544 :
UDP [::]:52788 :
UDP [::1]:1900 :
UDP [::1]:57545 :

C:\WINDOWS\system32>

Sorry for the late reply. I’ve been out of town. I don’t see anything listening on port 3306, which is the typical port used by MySQL. That implies that either a) MySQL is installed on the machine but not running; b) MySQL is installed on a different machine than the one you ran the command on; or c) MySQL is listening on a port other than 3306.

This looks like an issue related to MySQL, not anything Particle related. You may find more helpful answers on a MySQL forum.

2 Likes

Thanks for your answer!