Skip to content

Node Express Server Using node-mysql2 Crashes Periodically Due to Reliance on Deprecated Authentication Plugin #3366

Closed as not planned
@gebbber

Description

@gebbber

A Node Express server using this package (via express-mysql-session, which is confirmed to use this package at v3.10.2) crashes periodically due to reliance upon an authentication plugin that has been deprecated by MySQL.

Crashes occur randomly, not upon initial connection or when attempting to send queries:

/node_modules/express-mysql-session/node_modules/mysql2/promise.js:356
   const localErr = new Error();
                    ^

Error: Plugin 'mysql_native_password' is not loaded
   at PromisePool.query (/node_modules/express-mysql-session/node_modules/mysql2/promise.js:356:22)
   at /node_modules/express-mysql-session/index.js:384:30
   at new Promise (<anonymous>)
   at MySQLStore.query (/node_modules/express-mysql-session/index.js:381:10)
   at /node_modules/express-mysql-session/index.js:372:16 {
 code: 'ER_PLUGIN_IS_NOT_LOADED',
 errno: 1524,
 sql: undefined,
 sqlState: 'HY000',
 sqlMessage: "Plugin 'mysql_native_password' is not loaded"
}

MySQL documentation at https://dev.mysql.com/doc/refman/8.4/en/native-pluggable-authentication.html indicates:

Note
The mysql_native_password authentication plugin is deprecated as of MySQL 8.0.34, disabled by default in MySQL 8.4, and removed as of MySQL 9.0.0.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions