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: Client does not support authentication protocol requested by server; consider upgrading MySQL client #991

Closed
infusion opened this issue Jul 31, 2019 · 8 comments

Comments

@infusion
Copy link

Since MySQL 8, a new authentication algorithm is used, which introduces a breaking change. The mysql npm package received a PR for this. Maybe this helps improving this awesome packag: mysqljs/mysql#2233

Robert

@sidorares
Copy link
Owner

thanks @infusion , I'm aware of this and have put some initial efforts just didn't have time to finish ( I'd like to take slightly different approach to a mysqljs though ). See som related discussions in #975 #906 #820 . There is also some code in https://github.com/sidorares/node-mysql2/tree/mysql8-wip and https://github.com/sidorares/node-mysql2/tree/feature/fast-caching_sha2_password branches. Closing issue for now but feel free to add any relevant feedback here!

@infusion
Copy link
Author

infusion commented Aug 1, 2019

That's awesome news, thanks for the effort! Can you give any release date information?

@sidorares
Copy link
Owner

Regarding mysql 8 change - not going to promise anything, it was "very close" a year ago

unfortunately very little time right now, I'm the only active maintainer and I have day job and 6 kids :)

I'll try to keep doing small releases more often, maybe I'll cut next release this coming weekend

@fabiofcferreira
Copy link

Experiencing this issue and just wanted to add my support on this issue.

I can definitely start reading the docs and code and hopefully help you maintaining this wonderful package, what do you say? @sidorares

@sidorares
Copy link
Owner

Hey @fabiofcferreira , thanks for the offer! Happy to accept help, I'll try to write down priorities here in few minutes ( I think I already did that in previous issues, need to find and link to here )

@sidorares
Copy link
Owner

Ok so initial support for plugin auth landed 3 years ago ( #331 ) and I think it's time to rewrite it.

#906 (comment)
#560

So priorities now are:

  • agree on new authPlugin api
  • implement new plugin api system, make it work for both initial plugin name and "auth swich" flows ( and also change user command )
  • move existing auth code into corresponding plugins ( mysql_native_password etc ) and call that code from main protocol in case non plugin
  • add caching_sha2_password implementation as individual plugin

Main change to authPlugin api - I want to convert handler from (name, data, cb) to probably something like (name) => (data) => Promise
First call returns a function, that way we can close over some state for subsequent calls. First and subsequent ( AuthMoreData ) calls call that function and write back result returned as Buffer or Promise ( not quite sure yet about return type, need to double check here all possible auth flows. https://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::Handshake )

@fabiofcferreira
Copy link

I'll start reading the docs (I'm new to MySQL "deep" stuff) and I'll catch up

@sidorares
Copy link
Owner

The docs are not great . For the auth part - pay attention to initial handshake (default based on flags or plugin based), auth switch request and change user.

https://dev.mysql.com/doc/internals/en/connection-phase.html

( Actually on the second thought docs aren't too bad )

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

No branches or pull requests

3 participants