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-testeNo compatibility data collected yet for this library.
Demonstrates parameterized query usage to avoid SQL injection.
Use parameterized queries: msg.topic = 'SELECT ... WHERE col = :val'; msg.payload = { val: userInput }Set env vars in the Node-RED process environment, e.g., via systemd or Docker env.
Test thoroughly; consider using the original package if env var support is not needed.
npm install mysql2 in the Node-RED user directory (usually ~/.node-red)
Verify environment variables or UI config for host, user, password, database, port.