# \#mysql

**URL:** https://discourse.nodered.org/tag/mysql/92.md

[Latest](https://discourse.nodered.org/latest.md) · [Categories](https://discourse.nodered.org/categories.md) · [Tags](https://discourse.nodered.org/tags.md)

---

## [BLE data into a MySQL DB](https://discourse.nodered.org/t/ble-data-into-a-mysql-db/101720)

<div class="topic-metadata">

**Author:** [@GerB](https://discourse.nodered.org/u/GerB)\
**Replies:** 3\
**Last updated:** [3 September 2026 17:20 UTC](https://discourse.nodered.org/t/ble-data-into-a-mysql-db/101720 "2026-09-03T17:20:35Z")

</div>

Dear reader, I am just beginning with Node-red (5.0.4, npm 11.15.0) and have some trouble with the following. All the BLE messages I can receive with the BLE Scanner result in a lot of info and I would like to make it mo…

---

## [Hi everyone,  I’m working on a Node-RED flow where I need to read the same parameter from multiple Modbus slaves (Slave IDs 1 to 100)](https://discourse.nodered.org/t/hi-everyone-i-m-working-on-a-node-red-flow-where-i-need-to-read-the-same-parameter-from-multiple-modbus-slaves-slave-ids-1-to-100/100634)

<div class="topic-metadata">

**Author:** [@adarshi](https://discourse.nodered.org/u/adarshi)\
**Replies:** 6\
**Last updated:** [24 March 2026 17:06 UTC](https://discourse.nodered.org/t/hi-everyone-i-m-working-on-a-node-red-flow-where-i-need-to-read-the-same-parameter-from-multiple-modbus-slaves-slave-ids-1-to-100/100634 "2026-03-24T17:06:26Z")

</div>

Requirements: Read the same register/parameter from each slave (IDs 1 → 100) Optimize the flow for low CPU utilization Ensure efficient polling (avoid unnecessary load or blocking) Insert/store each slave’s data into an…

---

## [“POOL IS CLOSED” Error in mysql2 Node](https://discourse.nodered.org/t/pool-is-closed-error-in-mysql2-node/99413)

<div class="topic-metadata">

**Author:** [@shubhamnodered](https://discourse.nodered.org/u/shubhamnodered)\
**Replies:** 1\
**Last updated:** [16 October 2025 06:54 UTC](https://discourse.nodered.org/t/pool-is-closed-error-in-mysql2-node/99413 "2025-10-16T06:54:49Z")

</div>

Hi everyone, I recently came across an error in Node-RED related to the mysql2 node: "POOL IS CLOSED" This is what i saw in the debug window.... { "\_\_enc\_\_": true, "type": "error", "data": { "name": "Erro…

---

## [Modbus to mySQL flow suggestions](https://discourse.nodered.org/t/modbus-to-mysql-flow-suggestions/98531)

<div class="topic-metadata">

**Author:** [@BambosD](https://discourse.nodered.org/u/BambosD)\
**Replies:** 27\
**Last updated:** [7 August 2025 06:33 UTC](https://discourse.nodered.org/t/modbus-to-mysql-flow-suggestions/98531 "2025-08-07T06:33:40Z")

</div>

Hello everyone, i’m trying to log some values from modbus devices to the mySQL node. the flow is not very clear to me as functionality and setup, so i’m posting here what i’m trying to do and asking how is possible to a…

---

## [How to Insert TimeStamps Into SQL](https://discourse.nodered.org/t/how-to-insert-timestamps-into-sql/97655)

<div class="topic-metadata">

**Author:** [@Tecnolaundry](https://discourse.nodered.org/u/Tecnolaundry)\
**Replies:** 4\
**Last updated:** [20 June 2025 12:53 UTC](https://discourse.nodered.org/t/how-to-insert-timestamps-into-sql/97655 "2025-06-20T12:53:23Z")

</div>

good day to all of you i am new to node red, i need to create a table into a database that comes from an industrial laundry at a hospital, i need to create cycle start time and cycle finish time, i get errors about parse…

---

## [Insert the date and time separately into an SQL query](https://discourse.nodered.org/t/insert-the-date-and-time-separately-into-an-sql-query/97615)

<div class="topic-metadata">

**Author:** [@geronimo-78](https://discourse.nodered.org/u/geronimo-78)\
**Replies:** 5\
**Last updated:** [14 June 2025 20:25 UTC](https://discourse.nodered.org/t/insert-the-date-and-time-separately-into-an-sql-query/97615 "2025-06-14T20:25:05Z")

</div>

Hello, Excuse me for this naive question, but I'm a beginner. Here's my problem: I have a sensor that sends me speed information when an object passes in front of it. I want to record the date, time (in different colum…

---

## [Setting Environment Variables in MySQL Node (Docker-Node-RED)](https://discourse.nodered.org/t/setting-environment-variables-in-mysql-node-docker-node-red/95831)

<div class="topic-metadata">

**Author:** [@vskbot007](https://discourse.nodered.org/u/vskbot007)\
**Replies:** 17\
**Last updated:** [9 April 2025 04:18 UTC](https://discourse.nodered.org/t/setting-environment-variables-in-mysql-node-docker-node-red/95831 "2025-04-09T04:18:12Z")

</div>

Hello Node-RED community, I need some help with setting environment variables in the MySQL database node within a Docker-based Node-RED setup. What I’m Trying to Achieve I want to define my database connection details…

---

## [Handling errors in mysql](https://discourse.nodered.org/t/handling-errors-in-mysql/95973)

<div class="topic-metadata">

**Author:** [@apena](https://discourse.nodered.org/u/apena)\
**Replies:** 7\
**Last updated:** [13 March 2025 12:08 UTC](https://discourse.nodered.org/t/handling-errors-in-mysql/95973 "2025-03-13T12:08:18Z")

</div>

I have a MySQL database with a column email that is unique. I have an endpoint to insert data into the database. When I try to create a user with a duplicate email, I don't know how to get the ER\_DUP\_ENTRY error code tha…

---

## [Mysql INSERT or UPDATE multiple columns on duplicate key](https://discourse.nodered.org/t/mysql-insert-or-update-multiple-columns-on-duplicate-key/94357)

<div class="topic-metadata">

**Author:** [@philtao](https://discourse.nodered.org/u/philtao)\
**Replies:** 4\
**Last updated:** [5 January 2025 08:59 UTC](https://discourse.nodered.org/t/mysql-insert-or-update-multiple-columns-on-duplicate-key/94357 "2025-01-05T08:59:13Z")

</div>

Hi, I am new to Node-Red and after a few days of research I got the following flow to work, but it seems complicated to achieve something simple. I am wondering if there is a better way to do a SQL 'INSERT' with 'UPDAT…

---

## [MySql nodes compatible with node.js 20?](https://discourse.nodered.org/t/mysql-nodes-compatible-with-node-js-20/93910)

<div class="topic-metadata">

**Author:** [@Mike-FUT](https://discourse.nodered.org/u/Mike-FUT)\
**Replies:** 11\
**Last updated:** [15 December 2024 20:25 UTC](https://discourse.nodered.org/t/mysql-nodes-compatible-with-node-js-20/93910 "2024-12-15T20:25:17Z")

</div>

Hi All, I'd like to run select/insert/update MySQL queries via Node-RED. I'm using Node-RED 4.0.5 alsong with the recommended node.js version 20. I tried installing those packages: node-red-mysql-r2 node-red-node-my…

---

## [Insert text from web to Mysql, and show it on website securely](https://discourse.nodered.org/t/insert-text-from-web-to-mysql-and-show-it-on-website-securely/93590)

<div class="topic-metadata">

**Author:** [@hbb999](https://discourse.nodered.org/u/hbb999)\
**Replies:** 4\
**Last updated:** [1 December 2024 19:46 UTC](https://discourse.nodered.org/t/insert-text-from-web-to-mysql-and-show-it-on-website-securely/93590 "2024-12-01T19:46:17Z")

</div>

I send an url to our clients to give a feedback about our service: https://mycompany.com/evaluate?user\_id=1234 They can write some sentences into a textarea, and I send data back with POST method. I insert it with para…

---

## [mySQL datatable to OPC UA server using node-red](https://discourse.nodered.org/t/mysql-datatable-to-opc-ua-server-using-node-red/92460)

<div class="topic-metadata">

**Author:** [@skibidifanuc](https://discourse.nodered.org/u/skibidifanuc)\
**Replies:** 2\
**Last updated:** [18 October 2024 06:48 UTC](https://discourse.nodered.org/t/mysql-datatable-to-opc-ua-server-using-node-red/92460 "2024-10-18T06:48:31Z")

</div>

Hey! I'm struggling to send an array of extension objects through from mySQL to an OPC server. When I send values manually (for example I send 3 to point\[3\].fuseType) it works but I always struggle with the array. The p…

---

## [Yet another SQL timestamp doubt](https://discourse.nodered.org/t/yet-another-sql-timestamp-doubt/91301)

<div class="topic-metadata">

**Author:** [@shubhamnodered](https://discourse.nodered.org/u/shubhamnodered)\
**Replies:** 16\
**Last updated:** [1 October 2024 09:39 UTC](https://discourse.nodered.org/t/yet-another-sql-timestamp-doubt/91301 "2024-10-01T09:39:16Z")

</div>

Hi Guys and Hello node red team, My query is in reference to the point that Julius @TotallyInformation mentioned = "Always store DB entries in UTC" in the article " Wrong Timezone data in sql query result?!?" I found t…

---

## [Add mysql node via package.json but node-red doesnt load it](https://discourse.nodered.org/t/add-mysql-node-via-package-json-but-node-red-doesnt-load-it/91040)

<div class="topic-metadata">

**Author:** [@JePi](https://discourse.nodered.org/u/JePi)\
**Replies:** 1\
**Last updated:** [17 September 2024 12:30 UTC](https://discourse.nodered.org/t/add-mysql-node-via-package-json-but-node-red-doesnt-load-it/91040 "2024-09-17T12:30:32Z")

</div>

Add mysql node via package.json but node-red doesnt load it. But If enter the container and run npm install node-red-node-mysql it installs it and it works. But if restart the container its gone . Running Node-red in co…

---

## [Does Node Red requires TLS1.2 as a pre-requisites to connect to SQL DB?](https://discourse.nodered.org/t/does-node-red-requires-tls1-2-as-a-pre-requisites-to-connect-to-sql-db/90304)

<div class="topic-metadata">

**Author:** [@AlokPatil](https://discourse.nodered.org/u/AlokPatil)\
**Replies:** 2\
**Last updated:** [26 August 2024 16:07 UTC](https://discourse.nodered.org/t/does-node-red-requires-tls1-2-as-a-pre-requisites-to-connect-to-sql-db/90304 "2024-08-26T16:07:24Z")

</div>

Hello NodeRed Users/Developers, We have SCADA application which generates high frequency alarms/events and stores in local SQL database. 1. We would like to know whether Node-RED module requires TLS 1.2 as a pre-requisi…

---

## [SQL injection attacks security issue mysql](https://discourse.nodered.org/t/sql-injection-attacks-security-issue-mysql/89017)

<div class="topic-metadata">

**Author:** [@granxavi](https://discourse.nodered.org/u/granxavi)\
**Replies:** 16\
**Last updated:** [4 July 2024 13:32 UTC](https://discourse.nodered.org/t/sql-injection-attacks-security-issue-mysql/89017 "2024-07-04T13:32:19Z")

</div>

I HAVE ALREADY TRIED PREPARED STATEMENTS and STORED PROCEDURES but nothing seems to work. I am trying to implement a simple API where users can register on the DB. Everything works fine as expected. However, I noticed t…

---

## [Node-red mysql node credential setting from another function node/ui text field](https://discourse.nodered.org/t/node-red-mysql-node-credential-setting-from-another-function-node-ui-text-field/88639)

<div class="topic-metadata">

**Author:** [@Nilava1992](https://discourse.nodered.org/u/Nilava1992)\
**Replies:** 0\
**Last updated:** [12 June 2024 12:59 UTC](https://discourse.nodered.org/t/node-red-mysql-node-credential-setting-from-another-function-node-ui-text-field/88639 "2024-06-12T12:59:20Z")

</div>

Hi, I am using node red mysql node to connect with my database. Is there any process to push the credentials to the mysql node from another function node instead of opening the mysql node and set up the credentials? Th…

---

## [Doubt with data from Mysql A NodeRed and graph it](https://discourse.nodered.org/t/doubt-with-data-from-mysql-a-nodered-and-graph-it/87256)

<div class="topic-metadata">

**Author:** [@LilGrundy](https://discourse.nodered.org/u/LilGrundy)\
**Replies:** 7\
**Last updated:** [15 April 2024 21:58 UTC](https://discourse.nodered.org/t/doubt-with-data-from-mysql-a-nodered-and-graph-it/87256 "2024-04-15T21:58:21Z")

</div>

Good day colleagues, I have a question, it turns out that I am trying to extract data from the MySql table, and make a push to graph it in a chart, all with a date range, it turns out that it does not give any error some…

---

## [Little help in reducing mysql query load](https://discourse.nodered.org/t/little-help-in-reducing-mysql-query-load/86731)

<div class="topic-metadata">

**Author:** [@smanjunath211](https://discourse.nodered.org/u/smanjunath211)\
**Replies:** 4\
**Last updated:** [25 March 2024 11:25 UTC](https://discourse.nodered.org/t/little-help-in-reducing-mysql-query-load/86731 "2024-03-25T11:25:15Z")

</div>

I am using mysql query to get the data from a database every minute for last 60 minutes. now to update just the last minute data, i am querying again full 60 datapoints every minute (limit 60). is there a way to just tak…

---

## [Node-red mysql connection refused](https://discourse.nodered.org/t/node-red-mysql-connection-refused/86450)

<div class="topic-metadata">

**Author:** [@trisin](https://discourse.nodered.org/u/trisin)\
**Replies:** 9\
**Last updated:** [15 March 2024 14:12 UTC](https://discourse.nodered.org/t/node-red-mysql-connection-refused/86450 "2024-03-15T14:12:38Z")

</div>

Hi, team. i am running mysql server(127.0.0.1) 8.0 on my local windows machine. My node-red is running on a remote gateway (192.168.1.1) . my windows 10 computer is connected to the gateway through a ethernet cable. so …

---

## [Inserting Data into SQL database using OPCUA subscription mode](https://discourse.nodered.org/t/inserting-data-into-sql-database-using-opcua-subscription-mode/85691)

<div class="topic-metadata">

**Author:** [@shubhamnodered](https://discourse.nodered.org/u/shubhamnodered)\
**Replies:** 0\
**Last updated:** [20 February 2024 08:32 UTC](https://discourse.nodered.org/t/inserting-data-into-sql-database-using-opcua-subscription-mode/85691 "2024-02-20T08:32:31Z")

</div>

Hi Guys! With OPCUA read node and MySQL node, i can inject the PLC value into SQL database. And table looks as below. What i like to know that with OPCUA subscribe node, is it possible to feed data into SQL database …

---

## [Mysql insert error](https://discourse.nodered.org/t/mysql-insert-error/84841)

<div class="topic-metadata">

**Author:** [@jsprenkle](https://discourse.nodered.org/u/jsprenkle)\
**Replies:** 1\
**Last updated:** [23 January 2024 20:07 UTC](https://discourse.nodered.org/t/mysql-insert-error/84841 "2024-01-23T20:07:41Z")

</div>

Good afternoon, Having an issue using the mysql-r2 node. I'm doing a single insert statement into a table but keep getting parse errors. The only thing unusual about my sql is I used a reserved word for a column name. …

---

## [Disconnects with sql server](https://discourse.nodered.org/t/disconnects-with-sql-server/82373)

<div class="topic-metadata">

**Author:** [@ebolisa](https://discourse.nodered.org/u/ebolisa)\
**Replies:** 1\
**Last updated:** [26 October 2023 16:55 UTC](https://discourse.nodered.org/t/disconnects-with-sql-server/82373 "2023-10-26T16:55:33Z")

</div>

Hi, My project runs several nodes, some connect to an external mqtt server and others to an internal (home network) sql server on a Diskstation unit. When I go on extent vacations, I turn off my Diskstation server so, …

---

## [Mysqldump - how to create a backup of mysql database from node-red](https://discourse.nodered.org/t/mysqldump-how-to-create-a-backup-of-mysql-database-from-node-red/81133)

<div class="topic-metadata">

**Author:** [@smanjunath211](https://discourse.nodered.org/u/smanjunath211)\
**Replies:** 5\
**Last updated:** [10 September 2023 11:17 UTC](https://discourse.nodered.org/t/mysqldump-how-to-create-a-backup-of-mysql-database-from-node-red/81133 "2023-09-10T11:17:51Z")

</div>

Hi, I tried searching forum but could not get any relevant results. so here is the question. How do I make a backup of my mysql database from node-red ? I am able to create a backup using mysqldump command in the resp…
