
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
node-red-node-mysql
Advanced tools
A Node-RED node to read and write to a MySQL database.
Either use the Node-RED Menu - Manage Palette - Install
, or run the following command in your Node-RED user directory - typically ~/.node-red
npm i node-red-node-mysql
Allows basic access to a MySQL database.
This node uses the query operation against the configured database. This does allow both INSERTS and DELETES.
By its very nature it allows SQL injection... so be careful out there...
The msg.topic
must hold the query for the database, and the result is returned in msg.payload
.
Typically the returned payload will be an array of the result rows.
If nothing is found for the key then null is returned.
The reconnect retry timeout in milliseconds can be changed by adding a line to settings.js
mysqlReconnectTime: 30000,
The timezone can be set like GMT, EST5EDT, UTC, etc.
The charset defaults to the "old" Mysql 3 byte UTF. If you need support for emojis etc then use UTF8MB4.
msg.payload=[24, 'example-user'];
msg.topic="INSERT INTO users (`userid`, `username`) VALUES (?, ?);"
return msg;
with named parameters:
msg.payload={}
msg.payload.userToChange=42;
msg.payload.newUsername="example-user";
msg.topic="INSERT INTO users (`userid`, `username`) VALUES (:userToChange, :newUsername) ON DUPLICATE KEY UPDATE `username`=:newUsername;"
return msg;
Documentation of the used Node.js package
FAQs
A Node-RED node to read and write to a MySQL database
The npm package node-red-node-mysql receives a total of 1,506 weekly downloads. As such, node-red-node-mysql popularity was classified as popular.
We found that node-red-node-mysql demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.