背景:本地启动flask服务器后,前端页面登录时失败,但是去数据库查看账号密码正确。

解决过程:查看flask日志,发现如下:

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

在全局搜索了下sha256_password,发现是pymysql库_auth.py里面有这个方法,查看这个文件的导入部分,发现导入了cryptography库,那很明显是缺少了这个包。

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

pip install cryptography后就可以正常登录了。

相关文章:

  • 2021-08-18
  • 2021-10-02
  • 2022-01-08
  • 2022-12-23
  • 2022-12-23
  • 2021-10-29
  • 2021-08-20
猜你喜欢
  • 2021-10-27
  • 2022-12-23
  • 2021-10-14
  • 2022-12-23
  • 2021-09-22
  • 2022-12-23
  • 2021-08-06
相关资源
相似解决方案