# Database connection but not a connection?

**URL:** <https://discourse.nodered.org/t/database-connection-but-not-a-connection/47495>\
**Category:** General\
**Created:** [22 June 2021 19:08 UTC](https://discourse.nodered.org/t/database-connection-but-not-a-connection/47495 "2021-06-22T19:08:10Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [1 July 2021 05:50 UTC](https://discourse.nodered.org/t/database-connection-but-not-a-connection/47495/10 "2021-07-01T05:50:26Z")

</div>

I had a similar (timing??) problem a few months ago and ended-up creating a simple 'keep alive' flow.  
I just do a SELECT query every 15-minutes. There have been some updates (one just over a week ago) to node-red-node-mysql since I wrote the code, so I don't know if my workaround is still needed.

> [@MySQL fails after an hour or so](https://discourse.nodered.org/t/mysql-fails-after-an-hour-or-so/43225/17):
>
> Quick update to my test doing a SELECT query every 15-mins to see if MySQL connection remains active. My Telegram bot has been working fine for over 38 hours doing dB queries when requested by a user. I did try longer intervals (e.g. 30-mins and 45-mins) but settled on 15-mins for no real reason.

---

_[View the full topic](https://discourse.nodered.org/t/database-connection-but-not-a-connection/47495)._
