# Node Red data to SQL database

**URL:** https://discourse.nodered.org/t/node-red-data-to-sql-database/12941
**Category:** General
**Created:** [5 July 2019 06:49 UTC](https://discourse.nodered.org/t/node-red-data-to-sql-database/12941 "2019-07-05T06:49:36Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Aldic12Dy](https://avatars.discourse-cdn.com/v4/letter/a/b38774/32.png) [@Aldic12Dy](https://discourse.nodered.org/u/Aldic12Dy)
#### Post date: [5 July 2019 06:49 UTC](https://discourse.nodered.org/t/node-red-data-to-sql-database/12941/1 "2019-07-05T06:49:36Z")

</div>

Hi,  
While working with machine vibration and temperature, I want to create vibration and temp different values database .For this, I am using [ESP32](https://store.ncd.io/product/esp32-iot-wifi-ble-module-with-integrated-usb/) and [vibration sensor](https://store.ncd.io/product/iot-long-range-wireless-vibration-and-temperature-sensor/) .Can you suggest to me how to send data from Node-Red to SQL?

Thanks.

---

<div class="post-metadata">

### Author: ![afelix](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/afelix/32/9743_2.png) [@afelix](https://discourse.nodered.org/u/afelix)
#### Post date: [5 July 2019 07:06 UTC](https://discourse.nodered.org/t/node-red-data-to-sql-database/12941/2 "2019-07-05T07:06:36Z")

</div>

What kind of SQL database? Are we talking local sqlite instance, or a hosted postgres or oracle, or anything in between? What have you tried so far?

I got to say I hadn't ever heard of NCD, let alone their industrial iot wireless sensor products. Since joining the forum this is the third topic I'm seeing about one of those sensors. They look pretty nice, just outside my own budget range 🙂 From those previous topics I've learned that NCD has a tutorial on how to connect the sensors to Node-RED. Have you been following that tutorial, and can you show what you have written so far?

---

<div class="post-metadata">

### Author: ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)
#### Post date: [5 July 2019 07:08 UTC](https://discourse.nodered.org/t/node-red-data-to-sql-database/12941/3 "2019-07-05T07:08:22Z")

</div>

Is your esp sending any data ? to where ? Easiest would be to include the [pubsub](https://github.com/knolleary/pubsubclient) library to enable MQTT and work with a MQTT broker, which in turn can talk to node-red/database.

---

<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: [5 July 2019 07:52 UTC](https://discourse.nodered.org/t/node-red-data-to-sql-database/12941/4 "2019-07-05T07:52:53Z")

</div>

also look on the [flows.nodered.org](http://flows.nodered.org) site - and search for sql - there are example nodes and flows on there that may help.

---

<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: [5 July 2019 09:36 UTC](https://discourse.nodered.org/t/node-red-data-to-sql-database/12941/5 "2019-07-05T09:36:00Z")

</div>

If you want to be able to show charts of the data then you might like to look at Influxdb and grafana. Many people use node-red with influx for time series data storage, and grafana for showing charts, bar graphs etc.
