Registry / devops / mysql-punisher

mysql-punisher

JSON →
library2.1.4jsnpmunverified

MySQL Punisher (v2.1.4, last updated 2017) is a CLI tool that watches active MySQL queries and kills those exceeding a configurable timeout. It helps prevent long-running queries from exhausting connection pools. The tool runs as a daemon, polling `SHOW FULL PROCESSLIST` at a set interval. While functional for simple cases, it is no longer maintained and lacks support for newer MySQL authentication methods or modern Node.js versions. Alternatives include Percona Toolkit's `pt-kill` or custom scripts using the MySQL sys schema.

npm install mysql-punisher
INSTALL
IMPORT
SIG · MYSQL-PUNISHER
M
mysql-punisher
devopsjavascriptv2.1.4
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.

CLI usage
mysql-punisher -h localhost -u root -p
const mysqlPunisher = require('mysql-punisher')
This is a CLI tool, not a library. Do not import programmatically; invoke from shell.

Install globally and run to kill MySQL queries exceeding 30-second timeout, checking every 1 second.

npm install -g mysql-punisher mysql-punisher -h localhost -u root -p yourpassword -t 30 -i 1000
Debug
Known issues
breakingDoes not support MySQL 8's caching_sha2_password default authentication due to old 'mysql' npm package.
fix
Use mysql2 rather than the 'mysql' package. The project is unmaintained so you must fork or use `--auth-plugins=mysql_native_password`.
affects: >=2.0.0
deprecatedPackage has not been updated since 2017; several dependencies have known vulnerabilities (e.g., 'mysql' package issues).
fix
Consider using pt-kill (Percona Toolkit) or writing a custom script with mysql2.
affects: >=2.0.0
gotchaPassword passed as CLI argument visible in process listing. Use environment variables.
fix
Set MYSQL_PWD environment variable or use a configuration file.
affects: >=2.0.0
gotchaRequires global privileges (PROCESS and SUPER) to kill queries; if not granted, the tool fails silently.
fix
Grant appropriate privileges: GRANT PROCESS, SUPER ON *.* TO 'user'@'localhost';
affects: >=0.0.0
Errors
Common errors & fixes
Error: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client
Using mysql package with MySQL 8+ default auth plugin.
fix
Set default auth plugin to mysql_native_password on server, or use mysql2 package. For CLI: ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
Error: ER_ACCESS_DENIED_ERROR: Access denied for user 'root'@'localhost' (using password: YES)
Wrong password or no password provided.
fix
Verify password. Use -p option without value for interactive prompt, or pass password in command line (less secure).
Error: ER_SPECIFIC_ACCESS_DENIED_ERROR: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
MySQL user lacks PROCESS privilege.
fix
Grant PROCESS privilege: GRANT PROCESS ON *.* TO 'user'@'localhost';
Upgrade
Version history
2.1.4latest on npm
Audit
Dependencies
mysqlrequiredMySQL client driver for Node.js to connect and run queries.
commanderrequiredCommand-line argument parsing.
Agent activity
6 hits · last 30 days
node
6
Resources
mysql-punisher — npm install mysql-punisher · libregistry