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

 

posted @ 2021-11-28 18:06  陈晓猛  阅读(156)  评论(0编辑  收藏  举报