• 企业400电话
  • 微网小程序
  • AI电话机器人
  • 电商代运营
  • 全 部 栏 目

    企业400电话 网络优化推广 AI电话机器人 呼叫中心 网站建设 商标✡知产 微网小程序 电商运营 彩铃•短信 增值拓展业务
    完美解决mysql客户端授权后连接失败的问题

    在本地(192.168.1.152)部署好mysql环境,授权远程客户机192.168.1.%连接本机的mysql,在iptables防火墙也已开通3306端口。

    如下:

    mysql> select host,user,password from mysql.user;
    +--------------+-----------------+---------------------------------------------------------+
    | host | user | password |
    +--------------+-----------------+----------------------------------------------------------+
    | localhost | root | |
    | fdm1 | root | |
    | 127.0.0.1 | root | |
    | localhost | | |
    | fdm1 | | |
    | 192.168.1.% | db_hqsb | *DFC9DC16B13651A95ECEC3A26E07D244431B55C9 |
    | 192.168.1.% | db_ro_hqsb | *2C0B0DD50595BB40879110437BEEF026D019DFB7 |
    | 192.168.1.% | db_jkhwuser | *2C0B0DD50595BB40879110437BEEF026D019DFB7 |
    | 192.168.1.25| slave | *EE52B8EACB3CCD13624273AD6B5CDA52B9B53EB7 |
    | 192.168.1.% | tech_db_user | *6053E57C7B61043DC2C6B4E3291D5F61CCC23F5C |
    | 192.168.1.% | game_db_user| *05EA4D71C9A1273ECF3E24E6323F7175AE45C366 |
    | localhost | zabbix | *6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9 |
    +---------------+---------------+------------------------------------------------------------+

    问题:

    在客户机(比如192.168.1.20)上远程连接上面192.168.1.152机器的mysql,连接失败!

    [root@huanqiu ~]# mysql -udb_ro_hqsb -h 192.168.1.152 -pmhxzkhl0802xqsjdb
    ERROR 1130 (HY000): Host '192.168.1.20' is not allowed to connect to this MySQL server
    
    

    解决:

    是由于192.168.1.152的mysql里“host为localhost,user和password为空”这条语句导致的,删除这条即可解决问题!

    mysql> delete from mysql.user where host="localhost" and user="";
    Query OK, 1 row affected (0.00 sec)
    mysql> flush privileges;
    Query OK, 0 rows affected (0.00 sec)

    这样,授权连接的客户机就能成功连接了!

    [root@huanqiu ~]# mysql -uxqsj_db_ro_user -h 192.168.1.152 -pmhxzkhl0802xqsjdb
    Welcome to the MySQL monitor. Commands end with ; or \g.
    Your MySQL connection id is 28
    Server version: 5.1.73 Source distribution
    
    Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
    
    Oracle is a registered trademark of Oracle Corporation and/or its
    affiliates. Other names may be trademarks of their respective
    owners.
    
    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
    
    mysql>
    
    

    以上这篇完美解决mysql客户端授权后连接失败的问题就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持脚本之家。

    您可能感兴趣的文章:
    • 解决MySql客户端秒退问题(找不到my.ini)
    • PHP Swoole异步MySQL客户端实现方法示例
    • 解决Node.js mysql客户端不支持认证协议引发的问题
    • mysql8.0.11客户端无法登陆的解决方法
    • MySql使用skip-name-resolve解决外网链接客户端过慢问题
    • 解决MySQL客户端输出窗口显示中文乱码问题的办法
    • Windows下使用Cygwin编译MySQL客户端
    • ThinkPHP结合ajax、Mysql实现的客户端通信功能代码示例
    • MySQL 客户端不输入用户名和密码直接连接数据库的2个方法
    • MySQL 如何连接对应的客户端进程
    上一篇:mysqldump备份数据库时排除某些库的实例
    下一篇:MySQL修改root密码的多种方法(推荐)
  • 相关文章
  • 

    © 2016-2020 巨人网络通讯 版权所有

    《增值电信业务经营许可证》 苏ICP备15040257号-8

    完美解决mysql客户端授权后连接失败的问题 完美,解决,mysql,客户端,