# Mysql with function node

**URL:** <https://discourse.nodered.org/t/mysql-with-function-node/56032>\
**Category:** General\
**Created:** [3 January 2022 11:18 UTC](https://discourse.nodered.org/t/mysql-with-function-node/56032 "2022-01-03T11:18:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![perico](https://avatars.discourse-cdn.com/v4/letter/p/bbce88/32.png) [@perico](https://discourse.nodered.org/u/perico)\
**Post date:** [3 January 2022 11:18 UTC](https://discourse.nodered.org/t/mysql-with-function-node/56032/1 "2022-01-03T11:18:35Z")

</div>

Hi,

Can I post data to a mysql database via a function node? I have a limited Node-RED in my device and I can't install mysql node.

Thank you,  
Roger.

---

<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:** [3 January 2022 11:31 UTC](https://discourse.nodered.org/t/mysql-with-function-node/56032/2 "2022-01-03T11:31:29Z")

</div>

You could use the underlying mysql nodejs module (but you would have to install that), or you could do it using an exec node to execute an OS command to do it. It would be much easier with the mysql node though. Why can't you install it?

---

<div class="post-metadata">

**Author:** ![tree-frog](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/tree-frog/32/89303_2.png) [@tree-frog](https://discourse.nodered.org/u/tree-frog)\
**Post date:** [5 January 2022 01:11 UTC](https://discourse.nodered.org/t/mysql-with-function-node/56032/3 "2022-01-05T01:11:34Z")

</div>

You could use tcp or mqtt to talk to another device. Then have that device which can load the SQL node run the query. You can probably install node red on your sql server or MySQL server. This could also host your mqtt broker.

---

<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:** [6 March 2022 01:12 UTC](https://discourse.nodered.org/t/mysql-with-function-node/56032/4 "2022-03-06T01:12:10Z")

</div>

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