mysql身份验证问题

【错误1】

  pymysql.err.InternalError: (1130, "Host '127.0.0.1' is not allowed to connect to this MySQL server")的错误解决

【原因1】不容许本地机器连远程mysql服务,mysql 身份验证出现了问题

【解决1】使用下列步骤解决即可

mysql -u root -p

mysql>use mysql;

mysql>select 'host' from user where user='root';

mysql>update user set host = '%' where user ='root';

mysql>flush privileges;   #刷新权限

 

【错误2】

python连接数据库出现错误

RuntimeError: cryptography is required for sha256_password or caching_sha2_password

【解决2】

安装cryptography

pip install cryptography
声明 欢迎转载,但请保留文章原始出处:) 博客园:https://www.cnblogs.com/chenxiaomeng/ 如出现转载未声明 将追究法律责任~谢谢合作
原文地址:https://www.cnblogs.com/chenxiaomeng/p/15616017.html