当前位置:网站首页>Node red series (24): use MySQL nodes in node red to add, delete, modify and query databases

Node red series (24): use MySQL nodes in node red to add, delete, modify and query databases

2022-06-13 09:46:00 Bring me my Plaid

Background introduction

Today, a student wrote me a private letter , How to achieve in nr Operate the database in , And add, delete, modify and check the foundation .node-red Is based on nodejs Developed , If there's something like that node-red package , You can support database links , And read / write operations . After receiving this demand , First of all, we should look for the corresponding node-red package , See if there is a corresponding package . Click on node-red The menu in the upper right corner , Click node management , And click Install , Search in input box mysql,( If you are looking for mysql Read / write database ) Here's the picture . The following figure shows all the relevant mysql Operation Library , Click the link behind the library name , You can view the details of the library .
 Insert picture description here

Library installation and configuration

The library used in this article is node-red-node-mysql The latest version is 1.0.1 edition , Updated in the last three months .
https://flows.nodered.org/node/node-red-node-mysql Here is a detailed introduction to the library . From the details, we can know that this library is a node-red operation mysql Read / write node Library .

The library Allow for MySQL Basic access to the database , Such as query , Insert , Delete , But be careful sql Inject .

Executes sql Statement placed in msg.topic in , And the result will be msg.payload Pass down in the form of .

Usually , The payload returned will be an array of result rows .

If the key is not found , Then return to null.

developer It can be done by settings.js Add a line to change the reconnect retry timeout in milliseconds

mysqlReconnectTime: 30000,

The time zone

原网站

版权声明
本文为[Bring me my Plaid]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/164/202206130933276448.html