Home  >  Article  >  Database  >  解决MySQL ERROR 1130 (HY000): Host '192.168.1.8' is not allowe

解决MySQL ERROR 1130 (HY000): Host '192.168.1.8' is not allowe

WBOY
WBOYOriginal
2016-06-07 16:08:231746browse

解决MySQL ERROR 1130 (HY000): Host

解决MySQL ERROR 1130 (HY000): Host '192.168.1.8' is not allowed to connect to this MySQL server

本机是mysql的数据库,想用另一台ip为192.168.1.8的连接这个mysql数据库,可是报了这个错误。

查询得到2个方法

第一个是在user表把localhost改为%, 我这么做后不仅没有解决,本地连接都要root@%这么做了(现在想想好像失误把所有localhost都给改了)。

第二个方法就生效了。

终端登陆mysql,执行一句sql:

GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.1.8' IDENTIFIED BY 'www.linuxidc.com' WITH GRANT OPTION;

其中'www.linuxidc.com'就是设定连接密码了,然后192.168.1.8就可以连接了,简单有效,不是任意主机都可连,也安全一些。

Linux下MySQL Error 1130 不能远程访问 

本文永久更新链接地址:

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn