MYSQL教程完美解决mysql客户端授权后连接失败的问题
《MYSQL教程完美解决mysql客户端授权后连接失败的问题》要点: MYSQL学习在本地(192.168.1.152)部署好mysql环境,授权远程客户机192.168.1.%连接本机的mysql,在iptables防火墙也已开通3306端口. MYSQL学习如下: MYSQL学习mysql> select host,user,password from mysql.user; MYSQL学习问题: MYSQL学习在客户机(比如192.168.1.20)上远程连接上面192.168.1.152机器的mysql,连接失败! 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
MYSQL学习解决: MYSQL学习是由于192.168.1.152的mysql里“host为localhost,user和password为空”这条语句导致的,删除这条即可解决问题! MYSQL学习mysql> delete from mysql.user where host="localhost" and user=""; MYSQL学习这样,授权连接的客户机就能成功连接了! MYSQL学习
[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客户端授权后连接失败的问题就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持编程之家PHP. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |