Registry / database / pm2-mysql

pm2-mysql

JSON →
library1.0.0jsnpmunverified

A PM2 module to monitor a MySQL server with Keymetrics. Current stable version is 1.0.0, released in 2016. It provides metrics on MySQL connections, queries, slow queries, and disk I/O. It requires a MySQL server (tested against v5.6) and optionally iostat from sysstat for disk read/write monitoring. This package has not been updated in years and is largely obsolete; users should consider alternatives like PM2's built-in metrics or modern monitoring solutions.

npm install pm2-mysql
INSTALL
IMPORT
SIG · PM2-MYSQL
P
pm2-mysql
databasejavascriptv1.0.0
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.

pm2-mysql
pm2 install pm2-mysql
npm install pm2-mysql
This is a PM2 module, not a standard npm package. It must be installed via pm2 install.
Configuration
pm2 set pm2-mysql:key value
Editing config files directly
Configuration is done via pm2 set commands, not by editing files.
Uninstall
pm2 uninstall pm2-mysql
npm uninstall pm2-mysql
Uninstallation must be done via pm2 uninstall, not npm.

Installing and configuring pm2-mysql to monitor a MySQL server with Keymetrics.

# Install pm2-mysql module pm2 install pm2-mysql # Configure MySQL connection (optional, defaults used) pm2 set pm2-mysql:host localhost pm2 set pm2-mysql:port 3306 pm2 set pm2-mysql:user root pm2 set pm2-mysql:password your_password pm2 set pm2-mysql:refreshRate 1000 # Restart pm2 to apply changes pm2 restart all # View module metrics in Keymetrics dashboard
Debug
Known issues
deprecatedPackage is abandoned; no updates since 2016. May not work with modern PM2 or MySQL versions.
fix
Consider alternative monitoring solutions like PM2's built-in metrics or Prometheus exporters.
affects: >=1.0.0
gotchaRequires PM2 to be installed and running. Installing via npm will not work.
fix
Use pm2 install pm2-mysql instead of npm install.
affects: >=0.0.0
gotchaDisk I/O monitoring requires iostat and sysstat package on the system.
fix
Install sysstat (e.g., apt-get install sysstat) and ensure iostat is in PATH.
affects: >=0.0.0
gotchaMySQL slow query and general logs must be enabled and readable by the PM2 user.
fix
Enable slow_query_log and general_log in MySQL config and set log file permissions.
affects: >=0.0.0
Errors
Common errors & fixes
Module not found: pm2-mysql
Trying to install via npm instead of pm2.
fix
Use 'pm2 install pm2-mysql' instead of 'npm install pm2-mysql'.
Error: connect ECONNREFUSED
MySQL connection refused due to wrong host, port, or MySQL not running.
fix
Verify MySQL is running and accessible from the host. Check pm2-mysql configuration with pm2 set.
Error: Cannot find module 'mysql'
Missing mysql npm package dependency.
fix
Run 'npm install mysql' in the PM2 module directory or globally.
Keymetrics dashboard showing no data
PM2 module not properly connected to Keymetrics or misconfigured.
fix
Ensure PM2 is linked to Keymetrics account and pm2-mysql is correctly configured.
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies
mysqlrequiredRequired for connecting to MySQL server
pm2requiredRuntime dependency as a PM2 module
iostatoptionalRequired for disk I/O monitoring if dbDiskName is set
Agent activity
2 hits · last 30 days
node
2
Resources
pm2-mysql — npm install pm2-mysql · libregistry