A MySQL session store for the Connect/Express session middleware, version 4.0.0. It uses the node-mysql module for database connections and supports connection pooling, session encryption (AES-256-CTR), configurable retries, and automatic cleanup of expired sessions. Unlike generic session stores, it integrates directly with express-session and provides MySQL-specific features like keepalive pings. Release cadence is irregular; last release was in 2018. Key differentiators: built-in encryption and full MySQL pooling support. Note: v2.2 broke backward compatibility with previous session formats; sessions stored with older versions must be cleared or will be discarded with a warning.
npm install connect-mysqlNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates an Express app with MySQL-backed session storage, incrementing a view counter per session.
Delete all rows from the sessions table before upgrading, or set 'discard' option (not documented).
Consider using a maintained alternative like express-mysql-session.
Provide your own pool instance via `options.pool` for better control.
Set `cleanup: false` on all but one instance, and handle cleanup externally with a cron job or similar.
Correct: var MySQLStore = require('connect-mysql')(session); Then: var store = new MySQLStore(options);Ensure MySQL is running and config has correct host/port/user/password/database.
Clear the sessions table manually: DELETE FROM sessions;
Create the table manually: CREATE TABLE sessions (session_id VARCHAR(128) PRIMARY KEY, expires INT(11) UNSIGNED, data TEXT);
No dependency data recorded yet.