# Node-red-node-mysql stops working after some time

**URL:** <https://discourse.nodered.org/t/node-red-node-mysql-stops-working-after-some-time/54607>\
**Category:** General\
**Tags:** database\
**Created:** [1 December 2021 21:55 UTC](https://discourse.nodered.org/t/node-red-node-mysql-stops-working-after-some-time/54607 "2021-12-01T21:55:57Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Safouene28](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@Safouene28](https://discourse.nodered.org/u/Safouene28)\
**Post date:** [1 December 2021 21:55 UTC](https://discourse.nodered.org/t/node-red-node-mysql-stops-working-after-some-time/54607/1 "2021-12-01T21:55:57Z")

</div>

Hello everyone ,

Every time after about an hour ( more or less ) node red stops reacting. Some nodes still work like the gui input buttons but others like MYSQL stop working.

i tried to solve it with the mysqlReconnectTime at 15000,30000,60000 in settings.js but still stops...  
even i tried with 1800000 (30 mins) then 1200000 (20mins) but still the same problem . Also i tried to keep alive the connection with doing select 1 every 5 mins but nothing changed.

the mysql node is still green with the message connected.

the only way to solve it is to restart node-red or doing a deploy.

i am using the node-red-node-mysql version 0.1.1

Does any one faced this problem before please ?

---

<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:** [1 December 2021 23:11 UTC](https://discourse.nodered.org/t/node-red-node-mysql-stops-working-after-some-time/54607/2 "2021-12-01T23:11:45Z")

</div>

Hi, there is a new beta version you could try. It has to be installed manually by going into your user directory and then running. ` npm i node-red-node-mysql@next` and then restarting node-red. Any feedback much appreciated

---

<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:** [2 December 2021 07:14 UTC](https://discourse.nodered.org/t/node-red-node-mysql-stops-working-after-some-time/54607/3 "2021-12-02T07:14:34Z")

</div>

Just to clarify Dave's comment, it is the folder where your flows file, settings.js etc are that you need to run the command from, that is usually the .node-red folder

---

<div class="post-metadata">

**Author:** ![Safouene28](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@Safouene28](https://discourse.nodered.org/u/Safouene28)\
**Post date:** [2 December 2021 09:48 UTC](https://discourse.nodered.org/t/node-red-node-mysql-stops-working-after-some-time/54607/4 "2021-12-02T09:48:57Z")

</div>

thanks @dceejay for the quick answer , it will solve the problem ? . the version wich i'm using is not the correct one ? I mean that version of node mysql has this bug ?

---

<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:** [2 December 2021 09:52 UTC](https://discourse.nodered.org/t/node-red-node-mysql-stops-working-after-some-time/54607/5 "2021-12-02T09:52:08Z")

</div>

Hi,.... I don't know.... 🙂 the current latest version does appear to have memory leak so that over time it may either hang Node-RED or fail in some way... the new beta uses a different library and also fixes that bug... so it may fix your problem but I don't know... I am trying to get feedback as the underlying library is a different one so we want to be sure it is as near to 100% compatible as possible before releasing it widely... but if it helps fix your issue then that is extra good.

---

<div class="post-metadata">

**Author:** ![Safouene28](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@Safouene28](https://discourse.nodered.org/u/Safouene28)\
**Post date:** [2 December 2021 11:16 UTC](https://discourse.nodered.org/t/node-red-node-mysql-stops-working-after-some-time/54607/6 "2021-12-02T11:16:54Z")

</div>

I will test the beta version as soon as possible and go back with good news 😃 but i need to find let's call it a " temporary solution " to keep the node alive.

Any suggestions please ?

---

<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:** [2 December 2021 14:48 UTC](https://discourse.nodered.org/t/node-red-node-mysql-stops-working-after-some-time/54607/7 "2021-12-02T14:48:33Z")

</div>

That IS my suggestion

---

<div class="post-metadata">

**Author:** ![Safouene28](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@Safouene28](https://discourse.nodered.org/u/Safouene28)\
**Post date:** [2 December 2021 20:48 UTC](https://discourse.nodered.org/t/node-red-node-mysql-stops-working-after-some-time/54607/8 "2021-12-02T20:48:33Z")

</div>

Well , I Updated the mysql node and it's in the process of testing .

---

<div class="post-metadata">

**Author:** ![Safouene28](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@Safouene28](https://discourse.nodered.org/u/Safouene28)\
**Post date:** [3 December 2021 20:50 UTC](https://discourse.nodered.org/t/node-red-node-mysql-stops-working-after-some-time/54607/9 "2021-12-03T20:50:16Z")

</div>

Hello , like i said i updated to version 1.0.0beta5 and it seems no disconnection from the database, the node is working about 24hours , but i had too much disconnection from the wifi network, its about every 2, 3 mins !! .  
So my question : is that disconnection caused by node mysql ???  
when i did the update , the problem appeared !!

Thanks

---

<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:** [3 December 2021 22:55 UTC](https://discourse.nodered.org/t/node-red-node-mysql-stops-working-after-some-time/54607/10 "2021-12-03T22:55:48Z")

</div>

I can’t think how it could affect the WiFi.

---

<div class="post-metadata">

**Author:** ![Safouene28](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@Safouene28](https://discourse.nodered.org/u/Safouene28)\
**Post date:** [5 December 2021 21:32 UTC](https://discourse.nodered.org/t/node-red-node-mysql-stops-working-after-some-time/54607/11 "2021-12-05T21:32:09Z")

</div>

Well , The node is working perfectly until yesterday , will keep you update @dceejay .

Thanks.

---

<div class="post-metadata">

**Author:** ![Safouene28](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@Safouene28](https://discourse.nodered.org/u/Safouene28)\
**Post date:** [13 December 2021 14:19 UTC](https://discourse.nodered.org/t/node-red-node-mysql-stops-working-after-some-time/54607/12 "2021-12-13T14:19:39Z")

</div>

Hello it is me again 🙂 after the update the node is working without stop, but this errors appeared 2 days ago and appeared again Today : **TypeError: Cannot read property 'release' of undefined**. As we see in the screenshot node red restarded. Also sometimes he does it again successively.  
 ![error node mysq stops node-red 2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/6/266e97eb355473628dc58eb2cc1a3f102a6a1b9a.jpeg)

It seems he is trying to get the connexion if he didn't succeed it will fill the err variable and release the connexion.

 ![c2dfd6f5-be1d-474e-ba37-fc6abe54aeaa](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/7/07f8d9fb26950518928b0e48ec457e17db8883e8.jpeg)

Any help please ? @dceejay @Colin

---

<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:** [14 December 2021 20:51 UTC](https://discourse.nodered.org/t/node-red-node-mysql-stops-working-after-some-time/54607/13 "2021-12-14T20:51:22Z")

</div>

Hi - I do have a beta that should fix this problem - you can load it manually by going into your node-red user directory `cd ~/.node-red` and running `npm i node-red-node-mysql@next` . This should fix the memory leak but uses a different underlying library so I'm trying to get as much feedback as possible before releasing it fully.

Let me know how you get on. Thanks

---

<div class="post-metadata">

**Author:** ![Safouene28](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@Safouene28](https://discourse.nodered.org/u/Safouene28)\
**Post date:** [16 December 2021 09:37 UTC](https://discourse.nodered.org/t/node-red-node-mysql-stops-working-after-some-time/54607/14 "2021-12-16T09:37:50Z")

</div>

I already updated it to beta version 😃 but in the log I don't have any errors related to memory.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [14 February 2022 09:37 UTC](https://discourse.nodered.org/t/node-red-node-mysql-stops-working-after-some-time/54607/15 "2022-02-14T09:37:55Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
