怎么解决mysql不允许远程连接的错误1130 - Host'xxx.xxx.xxx.xxx' is not allowed to connect to this MySQL server“
来源:互联网 发布:高端黑 知乎 编辑:程序博客网 时间:2024/04/24 02:38
怎么解决mysql不允许远程连接的错误
- 1
- 2
- 3
- 4
- 5
- 6
- 7
最近使用Navicat for MySQl访问远程mysql数据库,出现报错,显示“1130 - Host'xxx.xxx.xxx.xxx' is not allowed to connect to this MySQL server“。解决办法如下:
方法/步骤
首先看报错窗口。
经查阅,错误原因是:本地IP(xxx.xxx.xxx.xxx)没有访问远程数据库的权限。
于是下面开启本地IP(xxx.xxx.xxx.xxx)对远程mysql数据库的访问权限。
首先远程连接进入服务器,在cms中输入mysql -u root -p,然后回车,输入密码后回车进入mysql命令行。
输入use mysql;
输入select user,password,host from user;
可以看到host中只有localhost主机。我们需要将xxx.xxx.xxx.xxx也添加到这里才对。
添加方法如下:
输入
grant all privileges on *.* to root@"xxx.xxx.xxx.xxx" identified by "密码";
这相当于是给IP-xxx.xxx.xxx.xxx赋予了所有的权限,包括远程访问权限。
然后再输入
flush privileges;
这相当于是重新加载一下mysql权限,这一步必须有。
再次输入select user,password,host from user;
可以看到host中已经有了新加的IP。
现在再次用Navicat for MySQl访问远程mysql数据库,已经能正常打开了。
问题解决。
不过还有一个问题,发现双击打开某张表的时候很慢,至少要3秒。
原因是:
当远程访问mysql时, mysql会解析域名, 所以会导致访问速度很慢, 会有2,3秒延时!
解决办法:
修改mysql安装目录下的my.ini,加上下面这个配置可解决此问题。在[mysqld]下加入:skip-name-resolve
保存退出后重启mysql服务。
然后访问速度就和本地一样快啦。
- 怎么解决mysql不允许远程连接的错误1130 - Host'xxx.xxx.xxx.xxx' is not allowed to connect to this MySQL server“
- mysql 远程连接--Host'xxx.xxx.xxx.xxx' is not allowed to connect to this MySQL server
- 解决:MYSQL远程连接错误码:1130 Host 'xxx' is not allowed to connect to this MySQL server
- 服务器连接错误Host 'XXX' is not allowed to connect to this MySQL server如何解决
- 解决服务器连接错误Host ‘XXX’ is not allowed to connect to this MySQL server
- 解决服务器连接错误Host ‘XXX’ is not allowed to connect to this MySQL server
- 解决服务器连接错误Host ‘XXX’ is not allowed to connect to this MySQL server
- 解决服务器连接错误Host ‘XXX’ is not allowed to connect to this MySQL server
- 解决服务器连接错误Host ‘XXX’ is not allowed to connect to this MySQL server
- 连接MySQL数据库报 "Host XXX.XXX.XXX.XXX is not allowed to connect to this MySQL server " 解决办法。
- 主机连接虚拟机MySQL报错:Host 'xxx.xxx.xxx.xxx' is not allowed to connect to this MySQL server
- MySQL远程连接Host 'XXX' is not allowed to connect to this MySQL server 解决方案
- 解决客户端与远程服务器端的连接(mysql) :xxx.xxx.xxx.xxx is not allowed to connect to this MySQL server
- Host ''xxx.xx.xxx.xxx'' is not allowed to connect to this MySQL server
- host'xx.xxx.xxx.xxx' is not allowed to connect to this mysql server
- 服务器连接错误Host 'XXX' is not allowed to connect to this MySQL server
- 服务器连接错误Host 'XXX' is not allowed to connect to this MySQL server
- 服务器连接错误Host 'XXX' is not allowed to connect to this MySQL server
- mysql-5.7.9-winx64 MySQL服务无法启动,服务没有报告任何错误的解决办法
- Java解惑
- kernel version magic问题
- 《 Swift ---->>UITextField 控件的学习和方法的详细解释《包含代理》》
- 双for循环实现九九乘法表
- 怎么解决mysql不允许远程连接的错误1130 - Host'xxx.xxx.xxx.xxx' is not allowed to connect to this MySQL server“
- nfs:server is not responding,still trying的解决方法
- 天声人語 20151204 「はやぶさ2」の長い旅
- 《秘密》卷一:秘密-爱的秘密
- PC上测试移动端网站和模拟手机浏览器
- 数据结构--二叉树按层次建立和按层次输出二叉树的内容
- 关于PHP一句话木马
- ios开发UIView自适应问题
- 日经春秋 20151204