Pycharm连接MySQL报错:RuntimeError: cryptography is required for sha256_password or caching_sha2_password
报错如下:image.png报错原因:MySQL8.0版本以后采用caching_sha2_password作为默认的身份验证插件。解决方法:登录mysql:mysql>mysql-uroot-pEnterpassword:查询用户密码:mysql>selecthost,user,authentication_stringfrommysql.user;设置(或修改)root用户密码:ALTERus