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-punisherNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Install globally and run to kill MySQL queries exceeding 30-second timeout, checking every 1 second.
Use mysql2 rather than the 'mysql' package. The project is unmaintained so you must fork or use `--auth-plugins=mysql_native_password`.
Consider using pt-kill (Percona Toolkit) or writing a custom script with mysql2.
Set MYSQL_PWD environment variable or use a configuration file.
Grant appropriate privileges: GRANT PROCESS, SUPER ON *.* TO 'user'@'localhost';
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';
Verify password. Use -p option without value for interactive prompt, or pass password in command line (less secure).
Grant PROCESS privilege: GRANT PROCESS ON *.* TO 'user'@'localhost';