zoukankan      html  css  js  c++  java
  • message from server: "Host 'XXXX' is not allowed to connect to this MySQL server"

    环境:mysql5.7.11 + windows10 64位

    问题现象:使用mysql远程登录命令mysql –uroot –h192.168.1.102 –p时,报错MySQL ERROR 1130 (HY000): Host ‘XXXX’ is not allowed to connect to this MySQL server

    问题原因:mysql服务器出于安全考虑,默认只允许本地登录数据库服务器。

    问题解决:登入mysql后,更改 “mysql” 数据库里的 “user” 表里的 “host” 项,从”localhost”改称”%”,然后重启mysql这样就允许所有的远程机器进行访问了。
    步骤1:修改mysql表

    mysql -u root -pvmware
    mysql>use mysql;
    mysql>update user set host = ‘%’ where user = ‘root’;
    mysql>flush privileges;
    mysql>select host, user from user;

    mysql>quit

    步骤2:重启mysql

    方法1:在windows设置中找到“查看本地服务”,找到mysql服务,重启mysql服务




    方法2:

    win 7 或者XP 直接 在cmd 命令行中打 net stop mysql /net start mysql来启停服务。
    win8及以上版本需要使用管理员权限才能使用cmd命令启动服务,笔者使用的是windows10,所以需要找到cmd.exe,右键后选择“以管理员身份运行”,然后再输入 net stop mysql /net start mysql来启停服务。


    步骤3:再次使用远程登录命令,就登录成功了。




    欢迎关注我的公众号:小秋的博客 CSDN博客:https://blog.csdn.net/xiaoqiu_cr github:https://github.com/crr121 联系邮箱:rongchen633@gmail.com 有什么问题可以给我留言噢~
  • 相关阅读:
    android —— textview解析html富文本
    android toolbar及可折叠标题栏
    dp——cf1327F
    cf1327D,E——组合数学
    技能表自查
    python 之禅 import this
    转--Python标准库之一句话概括
    python 爆破
    python -- 算法
    python 代码模板
  • 原文地址:https://www.cnblogs.com/flyingcr/p/10326923.html
Copyright © 2011-2022 走看看