IT忍者神龟之mysql远程连接:ERROR 1130 (HY000): Host '*.*.*.*' is not allowed to connect to this MySQL server解决
来源:互联网 发布:linux有文件夹进不去 编辑:程序博客网 时间:2024/06/07 16:56
安装完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
原因是因为你使用的mysql服务器版本中使用了新的密码验证机制,这需要客户端的版本要在4.0以上,原来的密码函数被改为old_password();,这样使用password()生成的密码在旧的版本上就可以解决这个问题了.
- IT忍者神龟之mysql远程连接:ERROR 1130 (HY000): Host '*.*.*.*' is not allowed to connect to this MySQL server解决
- 解决MySQL ERROR 1130 (HY000): Host 'XXX' is not allowed to connect to this MySQL server
- 解决MySQL ERROR 1130 (HY000): Host 'XXXX' 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解决办法
- mysql远程连接:ERROR 1130 (HY000): Host '*.*.*.*' is not allowed to connect to this MySQL server解决办法
- 解决ERROR 1130 (HY000): Host '192.168.1.9' is not allowed to connect to this MySQL server
- 远程连接mysql 出现: 1130: Host is not allowed to connect to this MySQL server 解决
- ERROR 1130 (HY000): Host 'xxxxxx' is not allowed to connect to this MySQL server解决办法
- ERROR 1130 (HY000): Host 'localhost' is not allowed to connect to this MySQL server
- ERROR 1130 (HY000): Host 'localhost' is not allowed to connect to this MySQL server
- ERROR 1130 (HY000): Host '192.168.225.128' is not allowed to connect to this MySQL server
- ERROR 1130 (HY000): Host '10.117.1.13' is not allowed to connect to this MySQL server
- ERROR 1130 (HY000): Host '172.16.0.123' is not allowed to connect to this MySQL server
- ERROR 1130 (HY000): Host '113.57.150.82' is not allowed to connect to this MySQL server
- ERROR 1130 (HY000): Host 'localhost' is not allowed to connect to this MySQL server
- ERROR 1130 (HY000): Host 'xxx' is not allowed to connect to this MySQL server
- ERROR 1130 (HY000): Host 'localhost' is not allowed to connect to this MySQL解决方式
- Win7查看本地是否安装JDK及安装路径的方法
- Dice (bfs)
- android 实现QQ好友分享和QQ空间分享
- PHPCMS v9图片模型图集相册获取图集的方法
- C#坐标提取
- IT忍者神龟之mysql远程连接:ERROR 1130 (HY000): Host '*.*.*.*' is not allowed to connect to this MySQL server解决
- 【我的算法日记】请实现一个函数,把字符串中的每个空格替换成“%20”。例如输入“We are happy.”,则输出“We%20are%20happy.”。
- android Binder详解 (1)
- oracle 11g 传输表空间(数据迁移)
- 海量数据处理之Bloom Filter详解
- POJ读书笔记6.1 - 约瑟夫问题 2746
- android敏捷开发
- Hibernate面试题
- 冒泡排序