{"id":43459,"library":"node-red-contrib-mysql-teste","title":"MySQL/MariaDB Node (Node-RED)","description":"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.","status":"active","version":"2406.1.101","language":"javascript","source_language":"en","source_url":"https://github.com/chillerno1/node-red-contrib-mysql-config","tags":["javascript","node-red","mysql"],"install":[{"cmd":"npm install node-red-contrib-mysql-teste","lang":"bash","label":"npm"},{"cmd":"yarn add node-red-contrib-mysql-teste","lang":"bash","label":"yarn"},{"cmd":"pnpm add node-red-contrib-mysql-teste","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"MySQL client library for Node.js","package":"mysql2","optional":false}],"imports":[],"quickstart":{"code":"// In a Node-RED function node:\nmsg.topic = 'SELECT * FROM `users` WHERE `name` = :name AND `age` > :age;';\nmsg.payload = { name: 'Adrien', age: 30 };\nreturn msg;","lang":"javascript","description":"Demonstrates parameterized query usage to avoid SQL injection."},"warnings":[{"fix":"Use parameterized queries: msg.topic = 'SELECT ... WHERE col = :val'; msg.payload = { val: userInput }","message":"Never put user input directly in msg.topic. Always use msg.payload for parameters.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Set env vars in the Node-RED process environment, e.g., via systemd or Docker env.","message":"Environment variables must be set before Node-RED starts; they are read at node instantiation.","severity":"gotcha","affected_versions":">=2406.1.101"},{"fix":"Test thoroughly; consider using the original package if env var support is not needed.","message":"This package is a fork specifically for env var configuration. It may not receive upstream bug fixes from stackhero.","severity":"gotcha","affected_versions":">=2406.1.101"}],"env_vars":null,"search_vec":"'2406.1.101':22 'across':52 'allow':35 'cadenc':66 'ci/cd':50 'configur':38 'connect':37 'contrib':31 'databas':20,36 'deploy':51 'enabl':49 'environ':40,54 'fork':26 'inject':64 'instead':42 'irregular':68 'javascript':69 'mariadb':19 'msg.payload':60 'multipl':53 'mysql':17,33,73 'mysql/mariadb':1 'node':2,4,8,10,29,46,71 'node-r':3,7,45,70 'node-red-contrib-stackhero-mysql':28 'parameter':57 'prevent':62 'queri':58 'read':12 'red':5,9,30,47,72 'releas':65 'sql':63 'stackhero':32 'support':56 'ui':48 'variabl':41 'version':21 'via':39,59 'write':14","created_at":"2026-06-05T16:59:54.021561+00:00","updated_at":"2026-06-05T16:59:54.021561+00:00","problems":[{"fix":"npm install mysql2 in the Node-RED user directory (usually ~/.node-red)","cause":"mysql2 package not installed in Node-RED runtime","error":"Error: Cannot find module 'mysql2'"},{"fix":"Verify environment variables or UI config for host, user, password, database, port.","cause":"Incorrect database credentials","error":"Error: ER_ACCESS_DENIED_ERROR: Access denied for user 'user'@'host' (using password: YES)"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/chillerno1/node-red-contrib-mysql-config#readme","github":"https://github.com/chillerno1/node-red-contrib-mysql-config","docs":null,"changelog":null,"pypi":null,"npm":"node-red-contrib-mysql-teste","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-05","next_check":"2026-09-03","install_tag":null}}