远程连接mysql失败,提示ERROR 1130 解决方法
2011-11-23 19:01
756 查看
Navicat for mysql 1130错误
ERROR 1130: Host'192.168.1.3' is not allowed to connect to this MySQL server
在哪查到得忘记了,自己又改了下
解决方法:
1。改表法。
可能是你的帐号不允许从远程登陆,只能在localhost。这个时候只要在localhost的那台电脑,登入mysql后,更改 "mysql" 数据库里的 "user" 表里的 "host" 项,从"localhost"改称"%"
mysql -u root-pvmware
mysql>usemysql;
mysql>updateuser set host = '%' where user = 'root';
mysql>selecthost, user from user;
mysql>flush privileges; 这条语句不能忘记,否则当前无效
正式环境建议指定为应用服务器的IP地址,比如'192.168.1.101'。 mysql -u root -pvmware mysql>use mysql; mysql>update user sethost = '%' where user = 'root';
2. 授权法。(推荐使用)
例如,你想myuser使用mypassword从任何主机连接到mysql服务器的话。
GRANT ALL PRIVILEGES ON *.* TO
'myuser'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
如果你想允许用户myuser从ip为192.168.1.3的主机连接到mysql服务器,并使用mypassword作为密码
GRANT ALL PRIVILEGES ON *.* TO
'myuser'@'192.168.1.101' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
ERROR 1130: Host'192.168.1.3' is not allowed to connect to this MySQL server
在哪查到得忘记了,自己又改了下
解决方法:
1。改表法。
可能是你的帐号不允许从远程登陆,只能在localhost。这个时候只要在localhost的那台电脑,登入mysql后,更改 "mysql" 数据库里的 "user" 表里的 "host" 项,从"localhost"改称"%"
mysql -u root-pvmware
mysql>usemysql;
mysql>updateuser set host = '%' where user = 'root';
mysql>selecthost, user from user;
mysql>flush privileges; 这条语句不能忘记,否则当前无效
正式环境建议指定为应用服务器的IP地址,比如'192.168.1.101'。 mysql -u root -pvmware mysql>use mysql; mysql>update user sethost = '%' where user = 'root';
2. 授权法。(推荐使用)
例如,你想myuser使用mypassword从任何主机连接到mysql服务器的话。
GRANT ALL PRIVILEGES ON *.* TO
'myuser'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
如果你想允许用户myuser从ip为192.168.1.3的主机连接到mysql服务器,并使用mypassword作为密码
GRANT ALL PRIVILEGES ON *.* TO
'myuser'@'192.168.1.101' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
相关文章推荐
- 黄聪:MYSQL远程连接失败:ERROR 1130: mysql 1130连接错误的有效解決方法
- MYSQL---远程连接mysql数据库提示:ERROR 1130的解决办法
- mysql远程链接 ERROR 1130:连接错误的解决方法
- 解决远程连接mysql错误1130代码的方法
- 远程连接mysql错误代码1130的解决方法
- 解决远程连接mysql错误1130代码的方法
- mysql远程连接错误1130的解决方法
- 远程连接mysql数据库提示:ERROR 1130的解决办法
- mysql1130远程连接没有权限的解决方法
- 通过Navicat for MySQL远程连接的时候报错mysql 1130的解决方法
- 解决远程连接mysql错误1130代码的方法
- mysql远程连接:ERROR 1130 (HY000): Host '*.*.*.*' is not allowed to connect to this MySQL server解决办法
- 远程连接 Mysql 失败的解决方法
- MySQL远程连接的时候报错mysql 1130的解决方法
- [转载]mysql远程连接错误1130的解决方法
- 通过Navicat for MySQL远程连接的时候报错mysql 1130的解决方法
- Navicat for mysql远程连接数据库详解(1130错误解决方法)
- Navicat for MySQL远程连接的时候报错mysql 1130的解决方法
- 远程连接mysql时,提示“is not allowed to connect to this MySQL server”的解决方法
- IT忍者神龟之mysql远程连接:ERROR 1130 (HY000): Host '*.*.*.*' is not allowed to connect to this MySQL server解决