2014-07-04 18:26:20 +02:00
|
|
|
node-red-node-mysql
|
|
|
|
========================
|
|
|
|
A <a href="http://nodered.org" target="_new">Node-RED</a> node to read and write to a MySQL database.
|
|
|
|
|
|
|
|
Install
|
|
|
|
-------
|
|
|
|
|
2020-03-01 18:06:22 +01:00
|
|
|
Either use the `Node-RED Menu - Manage Palette - Install`, or run the following command in your Node-RED user directory - typically `~/.node-red`
|
2014-07-04 18:26:20 +02:00
|
|
|
|
2020-03-20 15:59:08 +01:00
|
|
|
npm i node-red-node-mysql
|
2014-07-04 18:26:20 +02:00
|
|
|
|
|
|
|
|
|
|
|
Usage
|
|
|
|
-----
|
|
|
|
|
|
|
|
Allows basic access to a MySQL database.
|
|
|
|
|
|
|
|
This node uses the <b>query</b> operation against the configured database. This does allow both INSERTS and DELETES.
|
|
|
|
|
2020-03-20 15:59:08 +01:00
|
|
|
By its very nature it allows SQL injection... so <i>be careful out there...</i>
|
2014-07-04 18:26:20 +02:00
|
|
|
|
2016-03-02 14:27:22 +01:00
|
|
|
The `msg.topic` must hold the <i>query</i> for the database, and the result is returned in `msg.payload`.
|
2014-07-04 18:26:20 +02:00
|
|
|
|
|
|
|
Typically the returned payload will be an array of the result rows.
|
|
|
|
|
|
|
|
If nothing is found for the key then <i>null</i> is returned.
|
|
|
|
|
|
|
|
The reconnect retry timeout in milliseconds can be changed by adding a line to <b>settings.js</b>
|
|
|
|
<pre>mysqlReconnectTime: 30000,</pre></p>
|