Python报错 cryptography is required for sha256_password or caching_sha2_password auth methods

使用mysql8运行报cryptography is required for sha256_password or caching_sha2_password auth  methods
这段报错意思是说 sha256_password 和 caching_sha2_password 这两个加密算法需要用到 cryptography

1.解决方案
安装 cryptography python包,使其支持caching_sha2_password加密

pip install cryptography

2解决方案

查看用户和查看加密规则:(密码是安装MySQL是设置的)
SELECT user, host, plugin from mysql.user;

更新密码和加密方式
ALTER USER ‘root’@’localhost’ IDENTIFIED WITH mysql_native_password BY’密码’;

刷新权限
flush privileges;

扫码领红包

微信赞赏支付宝扫码领红包

发表回复

后才能评论