# BLE data into a MySQL DB

**URL:** <https://discourse.nodered.org/t/ble-data-into-a-mysql-db/101720>\
**Category:** General\
**Tags:** mysql, ble\
**Created:** [2 September 2026 11:10 UTC](https://discourse.nodered.org/t/ble-data-into-a-mysql-db/101720 "2026-09-02T11:10:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![GerB](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gerb/32/108298_2.png) [@GerB](https://discourse.nodered.org/u/GerB)\
**Post date:** [2 September 2026 11:10 UTC](https://discourse.nodered.org/t/ble-data-into-a-mysql-db/101720/1 "2026-09-02T11:10:05Z")

</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 more readable. I am already able to 'write' the data (JSON) into a MySQL table but as a single message. I would like to put the different items per mess in a viewable table. e.g. id in column id, address in column address and if possible in a ui-table with a point and click option (fase 2)

I already have:  
start and stop option for the BLE scanner  
JSON parser  
simple INSERT (SQL)  
and a DB connection to a table

Many thanks in advance,  
Ger

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [2 September 2026 11:18 UTC](https://discourse.nodered.org/t/ble-data-into-a-mysql-db/101720/2 "2026-09-02T11:18:56Z")

</div>

Here is a simple function to create an INSERT statement:

```auto
msg.payload = { 
"temperature": 842.9 ,
"location": "Reactor Core", 
}
msg.topic = "INSERT INTO temperatures" + " (location, temperature, timestamp) VALUES(:location, :temperature, CURRENT_TIMESTAMP())";
return msg

```

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [2 September 2026 11:38 UTC](https://discourse.nodered.org/t/ble-data-into-a-mysql-db/101720/3 "2026-09-02T11:38:47Z")

</div>

Unless you actually need to process the resulting data with SQL queries or the resulting data is very large (e.g. 10,000+ entries), using a DB is almost certainly overkill.

You can tell Node-RED to provide a file-based context store (see the docs) and use that to store your data as JSON instead.

You need it in that format anyway in order to display it as a table in Dashboard or UIBUILDER.

---

<div class="post-metadata">

**Author:** ![GerB](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gerb/32/108298_2.png) [@GerB](https://discourse.nodered.org/u/GerB)\
**Post date:** [3 September 2026 17:20 UTC](https://discourse.nodered.org/t/ble-data-into-a-mysql-db/101720/4 "2026-09-03T17:20:35Z")

</div>

Thanks for the info. After a reconsideration I aim my arrows on DASHBOARD and UIBUILDER. Regards
