Skip to content

Conversation

clue
Copy link
Contributor

@clue clue commented May 20, 2025

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:

Error: Connection to mysql://test:***@localhost/test failed during authentication: Client does not support authentication protocol requested by server; consider upgrading MySQL client (EACCES)

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 newer caching_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

@clue clue added this to the v0.7.0 milestone May 20, 2025
@clue clue requested a review from WyriHaximus May 20, 2025 21:40
@clue clue force-pushed the caching_sha2_password branch from b78281a to b5045a7 Compare May 21, 2025 18:33
@clue clue changed the title [WIP] Support caching_sha2_password authentication (MySQL 8+) Support caching_sha2_password authentication (MySQL 8+) May 21, 2025
@clue
Copy link
Contributor Author

clue commented May 21, 2025

Rebased now that #206 has been merged, this is now ready for review :shipit:

Copy link
Member

@WyriHaximus WyriHaximus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great to see this landing :shipit:

@WyriHaximus WyriHaximus merged commit 3ef58d8 into friends-of-reactphp:0.7.x May 21, 2025
15 checks passed
@clue clue deleted the caching_sha2_password branch May 21, 2025 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support caching_sha2_password authentication (MySQL 8+)
2 participants