# Connect to MYSQL server which is powered off during night

**URL:** <https://discourse.nodered.org/t/connect-to-mysql-server-which-is-powered-off-during-night/57366>\
**Category:** General\
**Created:** [27 January 2022 19:16 UTC](https://discourse.nodered.org/t/connect-to-mysql-server-which-is-powered-off-during-night/57366 "2022-01-27T19:16:27Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![hbb999](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hbb999/32/55150_2.png) [@hbb999](https://discourse.nodered.org/u/hbb999)\
**Post date:** [27 January 2022 19:16 UTC](https://discourse.nodered.org/t/connect-to-mysql-server-which-is-powered-off-during-night/57366/1 "2022-01-27T19:16:27Z")

</div>

Hello,

I connected Node Red to a remote MySQL server, which is powered off during nights, starting between 4pm and 8pm randomly. When it is powered on, I can connect to it.

But at night, when it is powered off, I keep receiving every 4-8 seconds the Error: connect ETIMEDOUT message.

Is it possible to connect to it when the remote server is powered on? Or get rid of these messages?

Thanks for your precious time,

Botond

---

<div class="post-metadata">

**Author:** ![mickym2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mickym2/32/36128_2.png) [@mickym2](https://discourse.nodered.org/u/mickym2)\
**Post date:** [27 January 2022 19:21 UTC](https://discourse.nodered.org/t/connect-to-mysql-server-which-is-powered-off-during-night/57366/2 "2022-01-27T19:21:15Z")

</div>

Capture the Error with a Catch node

---

<div class="post-metadata">

**Author:** ![hbb999](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hbb999/32/55150_2.png) [@hbb999](https://discourse.nodered.org/u/hbb999)\
**Post date:** [27 January 2022 20:14 UTC](https://discourse.nodered.org/t/connect-to-mysql-server-which-is-powered-off-during-night/57366/3 "2022-01-27T20:14:47Z")

</div>

I put a catch node with parameter: all and without output. The error message still comes to the debug panel every 2-3 seconds.

---

<div class="post-metadata">

**Author:** ![mickym2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mickym2/32/36128_2.png) [@mickym2](https://discourse.nodered.org/u/mickym2)\
**Post date:** [27 January 2022 20:40 UTC](https://discourse.nodered.org/t/connect-to-mysql-server-which-is-powered-off-during-night/57366/4 "2022-01-27T20:40:49Z")

</div>

OK another idea could be to use the ping node - so it will automatically be recognized when the remote server is on-or offline and you can block your flow as long as the server is unreachable or even check each message send to MySQL server if server is reachable.

---

<div class="post-metadata">

**Author:** ![hbb999](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hbb999/32/55150_2.png) [@hbb999](https://discourse.nodered.org/u/hbb999)\
**Post date:** [27 January 2022 21:36 UTC](https://discourse.nodered.org/t/connect-to-mysql-server-which-is-powered-off-during-night/57366/5 "2022-01-27T21:36:49Z")

</div>

This could work when the flow starts only when triggered. But I do not trigger the flow, but it still wants to connect to MySQL, and as the remote server is powered off, it can not connect to it. So I keep on receiving the error message to the debug panel.

---

<div class="post-metadata">

**Author:** ![mickym2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mickym2/32/36128_2.png) [@mickym2](https://discourse.nodered.org/u/mickym2)\
**Post date:** [27 January 2022 21:49 UTC](https://discourse.nodered.org/t/connect-to-mysql-server-which-is-powered-off-during-night/57366/6 "2022-01-27T21:49:28Z")

</div>

OK - if the error occurs even if no message receives the mySQL node - then I have no idea as well. Sorry. ☹

---

<div class="post-metadata">

**Author:** ![hbb999](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hbb999/32/55150_2.png) [@hbb999](https://discourse.nodered.org/u/hbb999)\
**Post date:** [27 January 2022 21:51 UTC](https://discourse.nodered.org/t/connect-to-mysql-server-which-is-powered-off-during-night/57366/7 "2022-01-27T21:51:17Z")

</div>

Thanks for your efforts, mickym2! 🙂

---

<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:** [28 March 2022 21:51 UTC](https://discourse.nodered.org/t/connect-to-mysql-server-which-is-powered-off-during-night/57366/8 "2022-03-28T21:51:29Z")

</div>

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