Home  >  Article  >  Database  >  mysql本地访问linux服务器,出现SQLSTATE[HY000][1130]Host'127.0.0.1&_MySQL

mysql本地访问linux服务器,出现SQLSTATE[HY000][1130]Host'127.0.0.1&_MySQL

WBOY
WBOYOriginal
2016-06-01 12:58:461150browse

解决方案:网上看了说,更改mysql库的user表,添加一条host为%的数据就可以,但是还是不行。后来,直接登录mysql,给访问加权限就可以了。

执行

[root@iZ25p77kem7Z ~]# GRANT ALL PRIVILEGES ON *.* TO 'username'@'%' IDENTIFIED BY 'userpwd' WITH GRANT OPTION;

就可以了

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