解決辦法,參考:https://github.com/chill117/express-mysql-session/issues/18
我們只需在實例化SessionStore的時候,配置useConnectionPooling: true。比如:
var sessionStore = new SessionStore({ host: 'localhost', port: 3306, user: 'root', password: 'root', database: 'session', useConnectionPooling: true });