{"id":13651,"library":"node-red-contrib-stackhero-mysql","title":"Node-RED MySQL/MariaDB Connector","description":"node-red-contrib-stackhero-mysql is a Node-RED contribution that provides a robust node for interacting with MySQL and MariaDB databases. Currently at version 1.0.6, this package maintains a stable release cadence, focusing on reliability and compatibility. Its primary differentiator is native support for TLS (SSL) encryption for secure connections, along with compatibility for the \"Caching SHA2 password\" authentication method, which is crucial for modern MySQL 8.x environments. This addresses a common pain point for users connecting to newer MySQL instances. The node simplifies database operations within Node-RED flows by allowing SQL queries in `msg.topic` and parameterized arguments in `msg.payload`, supporting various parameter styles including object-based, named, positional, and bulk insertions. It integrates seamlessly into Node-RED, extending its capabilities for data persistence and retrieval without requiring custom code for connection handling or authentication specifics.","status":"active","version":"1.0.6","language":"javascript","source_language":"en","source_url":"https://github.com/stackhero-io/node-red-contrib-stackhero-mysql","tags":["javascript","node-red","stackhero","mysql","mariadb"],"install":[{"cmd":"npm install node-red-contrib-stackhero-mysql","lang":"bash","label":"npm"},{"cmd":"yarn add node-red-contrib-stackhero-mysql","lang":"bash","label":"yarn"},{"cmd":"pnpm add node-red-contrib-stackhero-mysql","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Runtime dependency for MySQL/MariaDB database connectivity, providing TLS and Caching SHA2 password support.","package":"mysql2","optional":false},{"reason":"Peer dependency, as this is a Node-RED contribution node.","package":"node-red","optional":false}],"imports":[],"quickstart":{"code":"/*\nThis code would be placed in a Node-RED 'function' node.\nIt prepares the 'msg.topic' with an SQL query and 'msg.payload' with arguments.\nConnect this 'function' node's output to an 'Stackhero MySQL' node in your flow.\n*/\n\n// Example: Object-based insertion\nmsg.topic = 'INSERT INTO `users` SET ?';\nmsg.payload = { name: 'Adrien', age: 42 };\n\n// Example: Named parameters (uncomment to use)\n// msg.topic = 'INSERT INTO `users` (`name`, `age`) VALUES (:name, :age)';\n// msg.payload = { name: 'Romain', age: 12 };\n\n// Example: Positional parameters (uncomment to use)\n// msg.topic = 'INSERT INTO `users` (`name`, `age`) VALUES (?, ?)';\n// msg.payload = [ 'Eva', 28 ];\n\n// Example: Bulk (multi-row) insertion (uncomment to use)\n// msg.topic = 'INSERT INTO `users` (`name`, `age`) VALUES ?';\n// msg.payload = [[\n//   [ 'Alice', 30 ],\n//   [ 'Bob', 25 ]\n// ]];\n\nreturn msg;\n","lang":"javascript","description":"Demonstrates preparing `msg.topic` and `msg.payload` within a Node-RED function node for database interaction, showcasing various parameter passing methods."},"warnings":[{"fix":"Use parameterized queries. Place placeholders (like `?`, `:name`, `SET ?`, or `VALUES ?`) in `msg.topic` and provide the corresponding values in `msg.payload`.","message":"Directly embedding variables into `msg.topic` for SQL queries can lead to severe SQL injection vulnerabilities. Always use `msg.payload` to pass arguments to your queries.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Ensure that the 'Use TLS (SSL) encryption' option is enabled in the Node-RED node's configuration for your database connection.","message":"When connecting to a MySQL server configured with `--require_secure_transport=ON`, connections using insecure transport will be rejected with an 'Connections using insecure transport are prohibited' error.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Ensure you are using `node-red-contrib-stackhero-mysql` as it explicitly supports 'Caching SHA2 password' authentication. Verify your database user is configured with the correct authentication plugin if issues persist.","message":"Connecting to MySQL 8+ servers using older, incompatible MySQL clients or Node-RED nodes may result in 'ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server' errors, particularly with the 'Caching SHA2 password' authentication method.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'1.0.6':33 '8':75 'address':79 'allow':102 'along':59 'argument':109 'authent':67,148 'base':119 'bulk':123 'cach':64 'cadenc':40 'capabl':134 'code':143 'common':81 'compat':45,61 'connect':58,86,145 'connector':5 'contrib':9 'contribut':17 'crucial':71 'current':30 'custom':142 'data':136 'databas':29,94 'differenti':48 'encrypt':55 'environ':77 'extend':132 'flow':100 'focus':41 'handl':146 'includ':116 'insert':124 'instanc':90 'integr':126 'interact':24 'javascript':150 'maintain':36 'mariadb':28,156 'method':68 'modern':73 'msg.payload':111 'msg.topic':106 'mysql':11,26,74,89,155 'mysql/mariadb':4 'name':120 'nativ':50 'newer':88 'node':2,7,15,22,92,98,130,152 'node-r':1,14,97,129,151 'node-red-contrib-stackhero-mysql':6 'object':118 'object-bas':117 'oper':95 'packag':35 'pain':82 'paramet':114 'parameter':108 'password':66 'persist':137 'point':83 'posit':121 'primari':47 'provid':19 'queri':104 'red':3,8,16,99,131,153 'releas':39 'reliabl':43 'requir':141 'retriev':139 'robust':21 'seamless':127 'secur':57 'sha2':65 'simplifi':93 'specif':149 'sql':103 'ssl':54 'stabl':38 'stackhero':10,154 'style':115 'support':51,112 'tls':53 'user':85 'various':113 'version':32 'within':96 'without':140 'x':76","created_at":"2026-04-20T01:55:35.866830+00:00","updated_at":"2026-04-20T01:55:35.866830+00:00","problems":[{"fix":"In the Node-RED node's configuration, navigate to the database connection settings and check the 'Use TLS (SSL) encryption' box.","cause":"The MySQL/MariaDB server is configured to only accept secure (TLS/SSL) connections, but the Node-RED node is attempting an insecure connection.","error":"Connections using insecure transport are prohibited while --require_secure_transport=ON"},{"fix":"Confirm you are using the `node-red-contrib-stackhero-mysql` package, as it specifically includes support for 'Caching SHA2 password'. If the error persists, ensure your database user's authentication plugin is set correctly on the server.","cause":"The MySQL server (typically MySQL 8 or newer) is using an authentication method ('Caching SHA2 password') that the connecting client or Node-RED node does not support.","error":"ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":"https://stackhero.io","github":"https://github.com/stackhero-io/node-red-contrib-stackhero-mysql","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/node-red-contrib-stackhero-mysql","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database","web-framework"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-04-19","next_check":"2026-07-18","install_tag":null}}