Spoolman icon indicating copy to clipboard operation
Spoolman copied to clipboard

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

Open exciler opened this issue 4 months ago • 0 comments

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 avatar Mar 14 '24 19:03 exciler