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

Fluent cannot connect to MySQL 9: Unsupported auth plugin name: sha256_password #112

Open
vikingjs opened this issue Dec 14, 2024 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@vikingjs
Copy link

Describe the issue

The deprecated auth plugin has been removed, and Fluent seems to depend on it.

Vapor version

4.99.3

Operating system and version

MacOS 15.1.1

Swift version

Swift Package manager 6.0

Steps to reproduce

Install MySQL 9.0

Attempt to connect to it using Fluent

Outcome

2024-12-13T17:06:24-0800 error codes.vapor.application : database-id=mysql [AsyncKit] Opening new connection for pool failed: MySQL error: Unsupported auth plugin name: sha256_password

Additional notes

I looked through the config to see if there was any place to specify the auth plugin, but I could not find it.

@vikingjs vikingjs added the bug Something isn't working label Dec 14, 2024
@gwynne
Copy link
Member

gwynne commented Dec 14, 2024

The sha256_password auth method, which is not supported by MySQLNIO, is not commonly used in MySQL servers; most 8.x and 9.x servers use caching_sha2_password, which MySQLNIO does support. I'd recommend switching to the caching version if at all possible; MySQLNIO will not have support for sha256_password until the completion of the major in-progress rewrite it is currently undergoing, and I unfortunately don't have an ETA for that at this time.

@gwynne gwynne transferred this issue from vapor/fluent-mysql-driver Dec 14, 2024
@gwynne gwynne added enhancement New feature or request and removed bug Something isn't working labels Dec 14, 2024
@gwynne gwynne self-assigned this Dec 14, 2024
@gwynne
Copy link
Member

gwynne commented Dec 14, 2024

Leaving this issue open to track the support for additional auth methods in the rewrite.

@gwynne
Copy link
Member

gwynne commented Dec 14, 2024

More info about caching_sha2_password: https://dev.mysql.com/doc/refman/9.0/en/caching-sha2-pluggable-authentication.html Please note that sha256_password is described as deprecated.

@vikingjs
Copy link
Author

Perhaps I rolled back to MySQL 8.4 too hastily, but I have created the passwords with the caching version and I am back in business.

Thank you so much!

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

No branches or pull requests

2 participants