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

Error: Server requests authentication using unknown plugin sha256_password #1152

Closed
kellycampbell opened this issue May 3, 2020 · 6 comments · Fixed by #1153
Closed

Error: Server requests authentication using unknown plugin sha256_password #1152

kellycampbell opened this issue May 3, 2020 · 6 comments · Fixed by #1153

Comments

@kellycampbell
Copy link
Contributor

Started receiving this error from Ubuntu 20.04's mysql 8.0.19. My users are using caching_sha2_password and the server default is also set to that, however it's still requesting sha256_password. This may be a bug in Ubuntu's mysql build, but I went ahead an made an implementation of the auth plugin for node-mysql2 and will post a PR.

Error: Server requests authentication using unknown plugin sha256_password. See TODO: add plugins doco here on how to configure or author authentication plugins.
    at Object.authSwitchRequest (node_modules/mysql2/lib/commands/auth_switch.js:46:11)
    at ClientHandshake.handshakeResult (node_modules/mysql2/lib/commands/client_handshake.js:150:22)
    at ClientHandshake.execute (node_modules/mysql2/lib/commands/command.js:39:22)
    at Connection.handlePacket (node_modules/mysql2/lib/connection.js:417:32)
@ruiquelhas
Copy link
Contributor

Just FYI, this authentication plugin is deprecated since MySQL 8.0.16.

Because caching_sha2_password is the default authentication plugin in MySQL 8.0 and provides a superset of the capabilities of the sha256_password authentication plugin, sha256_password is deprecated and will be removed in a future MySQL version. MySQL accounts that authenticate using sha256_password should be migrated to use caching_sha2_password instead.

https://dev.mysql.com/doc/refman/8.0/en/sha256-pluggable-authentication.html

@kellycampbell
Copy link
Contributor Author

Just FYI, this authentication plugin is deprecated since MySQL 8.0.16.

Yes, I know. However, the default ubuntu 20.04 version 8.0.19-0ubuntu5 for some reason isn't working with the new method even though it's configured as the default and new users have their auth plugin set to caching_sha2_password.

@ruiquelhas
Copy link
Contributor

That's weird. What do you mean by default version? Where does it come from?

@kellycampbell
Copy link
Contributor Author

Not sure what in particular is wrong with my configuration. I installed mysql via ubuntu's apt packages. I started from a pre-release beta version of 20.04 on this machine so maybe that has something to do with it. I just installed on a fresh VM and am unable to reproduce.

@lapwingcloud
Copy link

Same issue here, select user, host, plugin from mysql.user; gives me back the user is using caching_sha2_password.

But mysql2 is giving me the error "Server requests authentication using unknown plugin sha256_password."

@lapwingcloud
Copy link

Turns out I was using the wrong user, sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants