Pycharm Connect MySQL to Find Sheet Error: RuntimeError: ‘cryptography’ package is required for sha256_password or caching_sha2_password auth methods

When linking MySQL database through pycharm, the query report will give an error prompt:

RuntimeError: ‘cryptography’ package is required for sha256_password or caching_sha2_password auth methods

Method 1: restart MySQL

① As an administrator, enter the command line “net start MySQL 80” in CMD (the service name of MySQL 80 is different here according to the installed version) to start mysql

② Enter “MySQL” to enter mysql.

③ pycharm runs again without reporting an error.

Method 2: install the cryptography package

Error: runtimeerror: ‘cryptography’ package is required for sha256_ password or caching_ sha2_ password auth methods

The error message means: sha256_Password and caching_sha2_ Password two encryption methods require cryptography.

Therefore, you only need to install the cryptography package: PIP install cryptography

① First, if you see mysql running in task manager.

② After opening cmd, enter the command "pip install cryptography", after successful installation, run pycharm again, no error is reported.

Similar Posts: