Registry / database / node-red-contrib-mysql-storage-plugin

node-red-contrib-mysql-storage-plugin

JSON →
library0.1.3jsnpmunverified

Node-RED plugin (v0.1.3) that stores Node-RED flows, credentials, settings, sessions, and library entries in MySQL. Built as a MySQL alternative to MongoDB storage plugin. Requires embedding Node-RED in a custom process. Library recall is not fully functional. Low release cadence; experimental.

npm install node-red-contrib-mysql-storage-plugin
INSTALL
IMPORT
SIG · NODE-RED-CONTRIB-M
N
node-red-contrib-mysql-storage-plugin
databasejavascriptv0.1.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
✓ const storageModule = require('node-red-contrib-mysql-storage-plugin');
✗ import storageModule from 'node-red-contrib-mysql-storage-plugin';
Plugin is CJS-only. ESM import is not supported.
storageModule
✓ const storageModule = require('node-red-contrib-mysql-storage-plugin');
Default export is the module itself, used as a property in Node-RED settings.

Configures Node-RED settings to use MySQL storage plugin with environment variables for credentials.

// settings.js const storageModule = require('node-red-contrib-mysql-storage-plugin'); const sqlConfig = { user: process.env.MYSQL_USER ?? 'root', password: process.env.MYSQL_PASSWORD ?? '', host: process.env.MYSQL_HOST ?? 'localhost', database: process.env.MYSQL_DATABASE ?? 'NodeRed', port: process.env.MYSQL_PORT ?? 3306 }; module.exports = { storageModule, storageModuleOptions: { sqlConfig, tableNames: { flows: 'NodeRedFlows', sessions: 'NodeRedSessions', credentials: 'NodeRedCredentials', settings: 'NodeRedSettings', library: 'NodeRedLibrary' } } };
Debug
Known issues
breakingRequires embedding Node-RED in custom process; cannot be used as a simple add-on.
fix
Follow embedding guide at http://nodered.org/docs/embedding.html.
affects: >=0.0.0
breakingTables must be created manually by running CreateTables.sql.
fix
Run provided SQL script against your MySQL database before starting Node-RED.
affects: >=0.0.0
deprecatedLibrary recall functionality is incomplete.
fix
Library entries can be saved but not retrieved; avoid using library feature or submit PR.
affects: <=0.1.3
gotchaPort property in sqlConfig must be a number, not a string.
fix
Use port: parseInt(process.env.MYSQL_PORT) || 3306.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'node-red-contrib-mysql-storage-plugin'
Plugin not installed or npm install ran in wrong directory.
fix
Run 'npm install --save node-red-contrib-mysql-storage-plugin' in the same directory as your custom Node-RED process.
Error: connect ECONNREFUSED 127.0.0.1:3306
MySQL server not running or connection config incorrect.
fix
Verify MySQL is running and sqlConfig host/port are correct. Use environment variables.
TypeError: sqlConfig must be an object
storageModuleOptions.sqlConfig is missing or incorrect.
fix
Ensure storageModuleOptions contains a valid sqlConfig object with user, password, host, database, and port.
Upgrade
Version history
0.1.3latest on npm
Audit
Dependencies
mysql2requiredMySQL database driver
Agent activity
9 hits · last 30 days
node
8
Resources
node-red-contrib-mysql-storage-plugin — npm install node-red-contrib-mysql-storage-plugin · libregistry