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

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

WBOY
Release: 2016-06-01 12:58:46
Original
1199 people have browsed it

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

执行

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

就可以了

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template