express-mysql-session 报错 Cannot enqueue Query after fatal error

章嘉致
2023-12-01

实例化时配置useConnectionPooling: true

var session = require('express-session');
var mysql = require('mysql');
var MySQLStore = require('express-mysql-session')(session);

var mysqlOption = {
	host: 'localhost',
	user: 'root',
	password: 'root',
	database: 'app',
	port: 3306,
    useConnectionPooling: true,
	schema:{
		tableName: 'session',
		columnNames:{
			session_id: 'session_id',
            expires: 'expires',
            data: 'data'
		}
	}
};

var sqlconnection = mysql.createConnection(mysqlOption)
var sessionStore = new MySQLStore({},sqlconnection)

https://github.com/chill117/express-mysql-session/issues/18

 类似资料: