报错
原因是Python环境中缺少cryptography包,是MySQL连接中用于sha256_password或caching_sha2_password这两种身份验证方法所必需的。
一、
黑窗口或其他连接工具手动连接一次数据库再次执行命令项目就运行成功了
当然不可能每次都手动连接一次[呲牙],那就使用方法二
二、
使用命令下载cryptography包
pip install cryptography
linux使用pip3
pip3 install cryptography
安装完后再次连接或重启项目文件后,连接成功
如果出现以下图中错误
使用下面方案解决
指定清华源下载
pip install cryptography -i https://pypi.tuna.tsinghua.edu.cn/simple
使用的是Python 3:
pip3 install cryptography -i https://pypi.tuna.tsinghua.edu.cn/simple
安装成功后执行启动项目命令