Registry / database / node-red-mysql-r2

node-red-mysql-r2

JSON →
library1.3.0jsnpmunverified

A Node-RED node to execute MySQL queries against a specified database table. Current stable version is 1.3.0, with irregular releases. Key differentiator: it integrates query execution directly into Node-RED flows with optional connection pooling, supporting host, port, database, username, password, and SQL via configuration or message properties. Compared to other MySQL nodes, it offers pooling parameters like connection limit and queue timeout, but has no TypeScript types and is not actively maintained.

npm install node-red-mysql-r2
INSTALL
IMPORT
SIG · NODE-RED-MYSQL-R2
N
node-red-mysql-r2
databasejavascriptv1.3.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

node
Drag from palette on Node-RED UI
This is a Node-RED custom node, not a standard npm module. It is loaded automatically by Node-RED after npm install. No JavaScript import is used.

Installs the node and shows how to use it in Node-RED by dragging from palette and configuring.

npm install node-red-contrib-mysql-r2 # Then in Node-RED: drag the mysql-r2 node from palette, configure and wire as needed.
Debug
Known issues
gotchaSensitive credentials (username, password) in flow JSON or configuration may be exposed if flows are shared or stored insecurely.
fix
Use environment variables or Node-RED's credential encryption to store credentials.
affects: all
gotchaNode uses the 'mysql' npm package under the hood; ensure MySQL server is compatible and that the 'mysql' package version does not introduce security issues.
fix
Check the 'mysql' dependency version in node_modules and update if necessary.
affects: >=1.0.0
gotchaConnection pooling enabled by default may exhaust database connections if flows are deployed without limits.
fix
Set connection limit and queue timeout appropriately in node configuration.
affects: >=1.0.0
gotchaNode overrides configuration with msg properties; if msg.sql, msg.username, etc. are accidentally set, they will override the configured values, potentially causing unexpected behavior.
fix
Clear msg.sql and other override properties if not intended.
affects: all
Errors
Common errors & fixes
Error: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client
MySQL 8+ default auth plugin is caching_sha2_password, but mysql npm package uses mysql_native_password.
fix
Set default_authentication_plugin=mysql_native_password in your MySQL config or ALTER USER 'user'@'host' IDENTIFIED WITH mysql_native_password BY 'password';
Error: connect ECONNREFUSED
MySQL host or port is incorrect or MySQL server not running.
fix
Verify host/port, ensure MySQL is running and accessible.
Error: ER_ACCESS_DENIED_ERROR: Access denied for user
Username or password is incorrect.
fix
Check credentials in node configuration or msg properties.
Error: Pool is closed
Attempting to execute query after pool has been destroyed or node has been stopped.
fix
Deploy the flow again or restart Node-RED.
Upgrade
Version history
1.3.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
5 hits · last 30 days
node
4
Resources
node-red-mysql-r2 — npm install node-red-mysql-r2 · libregistry