zoukankan      html  css  js  c++  java
  • Windows 通过本地计算机IP链接Mysql设置

    前言

    1.Mysql-1130错误:无法远程连接

    错误:ERROR 1130: Host '192.168.1.3' is not allowed to connect to thisMySQL serve
    错误1130:主机192.168.1.3”不允许连接到thismysql服务
    原因:被连接的数据不允许使用 192.168.1.3访问,只允许是用 localhost;
    

    2.解决思路

    帐号不允许从远程登陆,只能在localhost。
    这个时候只要在localhost的那台电脑,登入mysql后,更改"mysql" 数据库里的 "user" 表里的 "host"项,从"localhost"改称"%"
    

    3、启用 cmd

    输入 : mysql -u -root -p 
    若是提示 ‘mysql’不是内部或外部命令,也不是可运行的程序.那需要配置环境变量  在配置 path 变量添加 “……\mysq\MYSQL Server5.7\bin”
    

    4、配置命令如下

    mysql -u root -p
    mysql>use mysql;
    mysql>select Host,User from mysql.user;
    **host已经有了%这个值,直接运行命令:**
    


    刷新权限

    flush privileges;

    如host没有%这个值,直接运行命令:

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

    再次刷新权限

    flush privileges;

    查看root用户的权限

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

    注意:host已经有了%这个值,直接用Navicat链接即可!

    古今成大事者,不唯有超世之才,必有坚韧不拔之志!
  • 相关阅读:
    Media change : please insert the disk labeled
    ubuntu 关闭和开启防火墙
    CentOS6.3上部署Ceph
    Keepalived_vrrp: ip address associated with VRID not present in received packet
    Python 错误和异常小结
    nova network-vif-plugged 事件分析1
    ansible 之条件语句 when
    ansible 判断和循环
    openvswitch dpdk
    ES6之Promise
  • 原文地址:https://www.cnblogs.com/songwp/p/15671371.html
Copyright © 2011-2022 走看看