解决:RuntimeError: cryptography is required for sha256_password or caching_sha2_password

现象:Python连接MySQL数据库出现

RuntimeError: cryptography is required for sha256_password or caching_sha2_password

解决:安装cryptography

pip install cryptography

原因:

为了提供更安全的密码加密,MySQL8.0的首选默认认证插件是caching_sha2_password,而不是mysql_native_password。

你可能感兴趣的:(解决:RuntimeError: cryptography is required for sha256_password or caching_sha2_password)