Registry / database / node-red-contrib-mysql-teste

node-red-contrib-mysql-teste

JSON →
library2406.1.101jsnpmunverified

A Node-RED node to read and write to a MySQL or MariaDB database. Version 2406.1.101. This is a fork of node-red-contrib-stackhero-mysql that allows database connection configuration via environment variables instead of the Node-RED UI, enabling CI/CD deployments across multiple environments. It supports parameterized queries via msg.payload to prevent SQL injection. Release cadence is irregular.

npm install node-red-contrib-mysql-teste
INSTALL
IMPORT
SIG · NODE-RED-CONTRIB-M
N
node-red-contrib-mysql-teste
databasejavascriptv2406.1.101
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Demonstrates parameterized query usage to avoid SQL injection.

// In a Node-RED function node: msg.topic = 'SELECT * FROM `users` WHERE `name` = :name AND `age` > :age;'; msg.payload = { name: 'Adrien', age: 30 }; return msg;
Debug
Known issues
gotchaNever put user input directly in msg.topic. Always use msg.payload for parameters.
fix
Use parameterized queries: msg.topic = 'SELECT ... WHERE col = :val'; msg.payload = { val: userInput }
affects: >=0.0.0
gotchaEnvironment variables must be set before Node-RED starts; they are read at node instantiation.
fix
Set env vars in the Node-RED process environment, e.g., via systemd or Docker env.
affects: >=2406.1.101
gotchaThis package is a fork specifically for env var configuration. It may not receive upstream bug fixes from stackhero.
fix
Test thoroughly; consider using the original package if env var support is not needed.
affects: >=2406.1.101
Errors
Common errors & fixes
Error: Cannot find module 'mysql2'
mysql2 package not installed in Node-RED runtime
fix
npm install mysql2 in the Node-RED user directory (usually ~/.node-red)
Error: ER_ACCESS_DENIED_ERROR: Access denied for user 'user'@'host' (using password: YES)
Incorrect database credentials
fix
Verify environment variables or UI config for host, user, password, database, port.
Upgrade
Version history
2406.1.101latest on npm
Audit
Dependencies
mysql2requiredMySQL client library for Node.js
Agent activity
9 hits · last 30 days
node
8
Resources
node-red-contrib-mysql-teste — npm install node-red-contrib-mysql-teste · libregistry