盾怪网教程:是一个免费提供流行杀毒软件教程、在线学习分享的学习平台!

详细说明mysql客户端授权后连接失败的问题的处理方法

时间:2025/3/15作者:未知来源:盾怪网教程人气:

[摘要]+---------------+---------------+------------------------------------------------------------+问题:在客...
+---------------+---------------+------------------------------------------------------------+

问题:

在客户机(比如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客户端授权后连接失败的问题的解决办法的详细内容,更多请关注php中文网其它相关文章!


学习教程快速掌握从入门到精通的SQL知识。



关键词:详细说明mysql客户端授权后连接失败的问题的处理办法




Copyright © 2012-2018 盾怪网教程(http://www.dunguai.com) .All Rights Reserved 网站地图 友情链接

免责声明:本站资源均来自互联网收集 如有侵犯到您利益的地方请及时联系管理删除,敬请见谅!

QQ:1006262270   邮箱:kfyvi376850063@126.com   手机版