mysql远程连接:ERROR 1130 (HY000): Host '*.*.*.*' is not allowed to connect to this MySQL server解决办法
2013-11-14 20:56
901 查看
安装完MySQL后,远程连接数据库的时候,出现 ERROR 1130 (HY000): Host '192.168.0.1' is not allowed to connect to this MySQL server提示信息,不能远程连接数据库。考虑可能是因为系统数据库mysql中user表中的host是localhost的原因,于是,我尝试把这个值改为自己服务器的ip,果然就好用了,不过用 mysql -u root -p命令就连不上数据库了,需要用mysql -h 服务器ip -u root -p因为默认的连接mysql数据库user表中host的值,而这个命令的默认host是localhost,就连不上了。
具体操作方法:
用localhost连接上mysql后,
use mysql;
update user set host='123.456.789.254';(IP为你想要远程连接数据库的本地机器的IP)
\q;
退出mysql,然后重新启动mysql就可以了。
其他解决方案
2. 改表法。可能是你的帐号不允许从远程登陆,只能在localhost。这个时候只要在localhost的那台电脑,登入mysql后,更改 "mysql" 数据库里的 "user" 表里的 "host" 项,从"localhost"改称"%"
mysql -u root -pvmware
mysql>use mysql;
mysql>update user set host = '%' where user = 'root';
mysql>flush privileges;
mysql>select host, user from user;
3. 授权法。例如,你想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.0.1' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
***********************************************************************
phpMyAdmin说是用户名密码的问题,这就奇怪了,root用户名密码肯定没有问题,而且通过命令行连接没有问题。又仔细查看配置文件,还是没有问题。于是去搜了一下,找到这个解决方法.
先用root登录MYSQL服务器,执行
mysql>set password for 你要用的用户名@"localhost"=old_password('这个用户的密码');
原因是因为你使用的mysql服务器版本中使用了新的密码验证机制,这需要客户端的版本要在4.0以上,原来的密码函数被改为old_password();,这样使用password()生成的密码在旧的版本上就可以解决这个问题了.
转自:http://blog.sina.com.cn/s/blog_4ee4286501000c45.html
具体操作方法:
用localhost连接上mysql后,
use mysql;
update user set host='123.456.789.254';(IP为你想要远程连接数据库的本地机器的IP)
\q;
退出mysql,然后重新启动mysql就可以了。
其他解决方案
2. 改表法。可能是你的帐号不允许从远程登陆,只能在localhost。这个时候只要在localhost的那台电脑,登入mysql后,更改 "mysql" 数据库里的 "user" 表里的 "host" 项,从"localhost"改称"%"
mysql -u root -pvmware
mysql>use mysql;
mysql>update user set host = '%' where user = 'root';
mysql>flush privileges;
mysql>select host, user from user;
3. 授权法。例如,你想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.0.1' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
***********************************************************************
phpMyAdmin说是用户名密码的问题,这就奇怪了,root用户名密码肯定没有问题,而且通过命令行连接没有问题。又仔细查看配置文件,还是没有问题。于是去搜了一下,找到这个解决方法.
先用root登录MYSQL服务器,执行
mysql>set password for 你要用的用户名@"localhost"=old_password('这个用户的密码');
原因是因为你使用的mysql服务器版本中使用了新的密码验证机制,这需要客户端的版本要在4.0以上,原来的密码函数被改为old_password();,这样使用password()生成的密码在旧的版本上就可以解决这个问题了.
转自:http://blog.sina.com.cn/s/blog_4ee4286501000c45.html
相关文章推荐
- mysql远程连接:ERROR 1130 (HY000): Host '*.*.*.*' is not allowed to connect to this MySQL server解决办法
- mysql远程连接:ERROR 1130 (HY000): Host '*.*.*.*' is not allowed to connect to this MySQL server解决办法
- mysql远程连接:ERROR 1130 (HY000): Host '*.*.*.*' is not allowed to connect to this MySQL server解决办法
- IT忍者神龟之mysql远程连接:ERROR 1130 (HY000): Host '*.*.*.*' is not allowed to connect to this MySQL server解决
- ERROR 1130 (HY000): Host 'xxxxxx' is not allowed to connect to this MySQL server解决办法
- mysql不支持远程连接的解决办法(#1130 - Host 'localhost' is not allowed to connect to this MySQL server)
- mysql不支持远程连接的解决办法(#报错:1130-host ... is not allowed to connect to this MySql server 开放mysql远程连接 不使用lo
- mysql不支持远程连接的解决办法(#1130 - Host 'localhost' is not allowed to connect to this MySQL server)
- 远程mysql出现ERROR 1130 (HY000): Host '172.17.42.1' is not allowed to connect to this MySQL server
- mysql远程访问 登录ERROR 1130: is not allowed to connect to this MySQL server解决办法
- mysql不支持远程连接的解决办法(#1130 - Host 'localhost' is not allowed to connect to this MySQL server)
- 错误代码是1130,ERROR 1130: Host xxx.xxx.xxx.xxx is not allowed to connect to this MySQL server 是无法给远程连接的用
- 怎么解决mysql不允许远程连接的错误1130 - Host'xxx.xxx.xxx.xxx' is not allowed to connect to this MySQL server“
- 远程连接mysql 出现: 1130: Host is not allowed to connect to this MySQL server 解决
- 远程连接MYSQL提示:Host XXX is not allowed to connect to this MySQL server 解决办法
- mysql不能远程连接解决办法(Host is not allowed to connect to this MySQL server)
- 解决:MYSQL远程连接错误码:1130 Host 'xxx' is not allowed to connect to this MySQL server
- Mysql远程连接报错:SQL Error (1130): Host '192.168.61.128' is not allowed to connect to this MySQL server
- mysql连接linux系统提示“登录出现1130 is not allowed to connect to this MySql server”问题,解决方法
- ERROR 1130 (HY000): Host 'localhost' is not allowed to connect to this MySQL server