Dear Friends,
Believe me, I have done extensive search for this issue on node-red forum and other possible sites suggested by google. Somehow, I am not able to fix it.
I am using mysql node quite frequently. For one of my project, spread across 5 flows, it has been used around 43 times for access to same Mysql Database with same credentials. I need to have various queries for my dashboards. It was working quite well for about a month.
Now, I am facing an issue. I very frequently get error for mysql node : "Error: Pool is closed". I have following questions:
- How can I possible fix this issue?
- Is this issue because of using mysql node too many times?
Please help on this issue.
my flow example is as below:
[{"id":"48d3532b.b9f87c","type":"function","z":"7496a53c.c9e7dc","name":"","func":"var d = new Date()\nvar z = d.getFullYear()+'-'+(d.getMonth()+1)+'-'+(d.getDate()-1);\nvar t1 = 0 + \":\" + 0 + \":\" + 0;\nvar t2 = 23 + \":\" + 59 + \":\" + 59;\nvar a = z+' '+t1;\nvar b = z+' '+t2;\nmsg.topic = 'select M1_KVAH as grid_cons from em1_live_values where time_stamp between \"'+a+'\" and \"'+b+'\" and M1_KVAH > 0 order by time_stamp desc limit 1';\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":340,"y":1740,"wires":[["5a1ba33f.40c04c"]]},{"id":"8d85ff65.ae86e","type":"function","z":"7496a53c.c9e7dc","name":"","func":"var str = msg.payload;\nstr = str[0]['grid_cons'];\nmsg.payload = str;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":720,"y":1740,"wires":[["c1a1083e.0bcf28"]]},{"id":"5a1ba33f.40c04c","type":"mysql","z":"7496a53c.c9e7dc","mydb":"18593ab4.649a45","name":"Query","x":510,"y":1740,"wires":[["8d85ff65.ae86e"]]},{"id":"a649c8e4.09b4f8","type":"function","z":"7496a53c.c9e7dc","name":"","func":"var d = new Date()\nvar z = d.getFullYear()+'-'+(d.getMonth()+1)+'-'+(d.getDate()-1);\nvar t1 = 0 + \":\" + 0 + \":\" + 0;\nvar t2 = 23 + \":\" + 59 + \":\" + 59;\nvar a = z+' '+t1;\nvar b = z+' '+t2;\nmsg.topic = 'select M1_KVAH from em1_live_values where time_stamp between \"'+a+'\" and \"'+b+'\" and M1_KVAH > 0 order by time_stamp limit 1';\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":340,"y":1800,"wires":[["cee9dc66.e9f98"]]},{"id":"65920934.1aa7c8","type":"function","z":"7496a53c.c9e7dc","name":"","func":"var str = msg.payload;\nstr = str[0]['M1_KVAH'];\nmsg.payload = str;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":720,"y":1800,"wires":[["c1a1083e.0bcf28"]]},{"id":"cee9dc66.e9f98","type":"mysql","z":"7496a53c.c9e7dc","mydb":"18593ab4.649a45","name":"query2","x":490,"y":1800,"wires":[["65920934.1aa7c8"]]},{"id":"96d99e31.f8f5e","type":"inject","z":"7496a53c.c9e7dc","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":150,"y":1740,"wires":[["48d3532b.b9f87c","a649c8e4.09b4f8"]]},{"id":"c1a1083e.0bcf28","type":"debug","z":"7496a53c.c9e7dc","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":910,"y":1760,"wires":[]},{"id":"18593ab4.649a45","type":"MySQLdatabase","name":"","host":"127.0.0.1","port":"3306","db":"Aditya_EMS","tz":"+05:30","charset":"UTF8"}]