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;
微信赞赏支付宝扫码领红包
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。侵权投诉:375170667@qq.com