A Node-RED node for querying MySQL and MariaDB databases, forked from node-red-contrib-stackhero-mysql (v1.0.4). This version enables configuring database connections via environment variables instead of hardcoding credentials in the Node-RED UI. It supports parameterized queries (using named placeholders in msg.topic and values in msg.payload) to prevent SQL injections. Released as a minor fork, it maintains the same API as the original but adds CI/CD-friendly configuration. Suitable for Node-RED instances deployed across environments where credentials must be set at runtime.
npm install node-red-contrib-mysql-configNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to perform a parameterized SQL query using the mysql-config node, with named placeholders in topic and values in payload.
Use named placeholders (:name) in topic and pass values as object keys in payload.
Run 'npm install mysql2' in the Node-RED user directory (usually ~/.node-red).
Check that the environment variable for host is set and the node configuration matches the variable name.
Ensure SQL syntax is correct for MySQL/MariaDB and verify string escaping.