A production-level Node.js wrapper for mysqljs/mysql that provides intelligent management and load balancing of MySQL connection pools. It automatically scales connections based on load, closes idle connections to prevent exhaustion of server max_connections, and supports instancing for custom clustering. Current stable version is 1.5.9, last updated in 2019. It requires mysql@>=2.14.0 <3.0.0 as a peer dependency and supports Node.js 8+. Key differentiators: automatic idle connection cleanup, dynamic configuration changes, and exported internal functions for custom scripts.
npm install mysql-connection-pool-managerNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates creating a MySQL connection pool manager, getting a connection, executing a query, and releasing the connection.
Update to pass poolConfig and poolManagerConfig as separate properties.
Use `getConnection()` and `releaseConnection()` instead of manipulating the pool directly.
Install mysql@2.x (e.g., npm install mysql@2.18.1).
Set a higher `maxQueue` value in poolManagerConfig if you expect many concurrent requests.
Set `trace: false` to suppress deprecation warnings; remove in future.
Run `npm install mysql-connection-pool-manager` and ensure no typo in require/import.
Ensure each route handler sends only one response; avoid calling next() after res.send()/res.json()
Use correct import: `const PoolManager = require('mysql-connection-pool-manager'); const poolManager = new PoolManager(...)`