Support caching_sha2_password
authentication (MySQL 8+)
#207
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This changeset adds support for
caching_sha2_password
authentication to add support for MySQL 8+. This authentication plugin is the default as of MySQL 8+ and is required to make the client work with MySQL 9+.This builds on top of the authentication plugin functionality added in #206. Prior to these changes, connecting to a server using
caching_sha2_password
authentication reported the following error:With these changes applied, connection now works successfully using
caching_sha2_password
authentication when requested. This means MySQL 5 and MySQL 8 and MySQL 9 should be supported just fine now.The affected code has 100% code coverage and has been tested against a number of MySQL server versions. The tests confirm it should continue to work for legacy servers not using authentication plugins or newer MySQL server versions using the existing
mysql_native_password
authentication or newercaching_sha2_password
authentication. We should probably follow-up on PR #196 to add more MySQL server versions to our test matrix, but I've kept this out of this PR to ease review.Marking this as WIP until the base functionality is merged via #206.Update: merged.Builds on top of #206 and others
Resolves / closes #112