Use pymysql 报错RuntimeError 'cryptography' package is required for sha256_password or caching_sha2_passw

Use pymysql to connect to the MySql database and report an error RuntimeError:

'cryptography' package is required for sha256_password or caching_sha2_password auth methods

20221223232027

The error message means: sha256_password and caching_sha2_password encryption methods require cryptography.

So just install the cryptography package:

pip install cryptography

20221223232140

After the installation is complete, execute it again, and it will be ok.

Guess you like

Origin blog.csdn.net/hubing_hust/article/details/128425426