connect-mysql2 is a MySQL-backed session store for Express/Connect applications, version 2.2.6. It uses the mysql2 driver and provides features like connection pooling, session encryption, keepalive, and automatic cleanup. Its release cadence is low; it is actively maintained. Compared to alternatives like connect-mysql (which uses the older mysql driver), it benefits from the mysql2 performance and promise support. Not intended for use with MySQL 2.x, but rather with the mysql2 npm package. Sessions from earlier versions are not backwards-compatible with v2.2.
npm install connect-mysql2No compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Sets up an Express app with MySQL-backed session storage using connect-mysql2, showing basic configuration and usage.
Clear the sessions table before upgrading to v2.2, or expect warnings.
Use const MySQLStore = require('connect-mysql2')(session);Run `npm install mysql2` in your project.