zoukankan      html  css  js  c++  java
  • pycharm连接数据库报错:1130-host ... is not allowed to connect to this MySql server如何处理

    使用pycharm调取本地mysql,没有任何问题,当连接ecs上的mysql,将数据库连接中的 localhost 换成 ip 地址后,报错:

    1130-host ... is not allowed to connect to this MySql server

    这个问题是因为在数据库服务器中的mysql数据库中的user的表中没有权限(也可以说没有用户),下面将记录我遇到问题的过程及解决的方法。

    遇到这个问题首先到mysql所在的服务器上用连接进行处理

    1、连接服务器: mysql -u root -p

    2、看当前所有数据库:show databases;

    3、进入mysql数据库:use mysql;

    4、查看mysql数据库中所有的表:show tables;

    5、查看user表中的数据:select Host, User,Password from user;

    6、修改user表中的Host:update user set Host='%' where User='root';

    7、最后刷新一下:flush privileges;

    注意,第7步必须执行,否则不能pycharm连接依然会报错(pymysql.err.OperationalError)

  • 相关阅读:
    画板
    多线程
    Runtime
    今日头条UI搭建
    支付宝UI界面搭建
    控制器的创建
    UIWindow简单介绍
    UIApplication
    UIPickerView的使用
    代理、通知、KVO
  • 原文地址:https://www.cnblogs.com/ice5/p/13819369.html
Copyright © 2011-2022 走看看