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

Unable to connect to MySQL 8.x with default settings (Docker) #330

Open
exciler opened this issue Mar 14, 2024 · 0 comments
Open

Unable to connect to MySQL 8.x with default settings (Docker) #330

exciler opened this issue Mar 14, 2024 · 0 comments
Labels
Bug Something isn't working

Comments

@exciler
Copy link

exciler commented Mar 14, 2024

Describe the bug
In MySQL 8.x the default authentication plugin has changed to "caching_sha2_password" which is a more secure hashing algorithm using SHA256. When trying to connect to a MySQL-Server with a user that has the new default auth plugin enabled, connection fails with the following error:
RuntimeError: 'cryptography' package is required for sha256_password or caching_sha2_password auth methods

To Reproduce

  1. Install or use an existing MySQL 8.x Server
  2. Create a user with default settings "CREATE USER spoolman IDENTIFIED BY 'secret'"
  3. Use this Server/User in the Spoolman Docker container

Expected behavior
Spoolman should be able to connect to MySQL 8.x Server with default user settings and without compromising security.

Additional context
Actually the solution to this problem is already included in the error message. PyMySQL needs the "crptography" package which is included when using PyMySQL[rsa] or aiomysql[rsa] but unfortunately not via SQLAlchemy. I think the problem can be solved by including any of the following dependencies:

  • aiomysql[rsa]
  • PyMySQL[rsa]
  • cryptography

As I am not that familiar with python package management I can not decide which way would be the best and kindly ask for your help here.

@exciler exciler added the Bug Something isn't working label Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant