Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
gebbber opened this issue Feb 2, 2025 · 1 comment · May be fixed by #2143

Comments

@gebbber
Copy link

gebbber commented Feb 2, 2025

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.

@wellwelwel
Copy link
Collaborator

Hi, @gebbber 🙋🏻‍♂️

Do you think it's possible to create a minimal reproduction using a Docker container (for example) and using only MySQL2?

Currently, we run the entire test suite with the latest available version dynamically:

'mysql:9.0.1',
'mysql:latest',

@wellwelwel wellwelwel linked a pull request Feb 4, 2025 that will close this issue
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants