Home > Database > Mysql Tutorial > body text

mysql error 1130 hy000:Host'localhost'解决方案_MySQL

WBOY
Release: 2016-06-01 13:23:15
Original
976 people have browsed it

bitsCN.com ERROR 1130 (HY000): Host 'localhost' is not allowed to connect to this MySQL server www.bitsCN.com

出现原因:
mysql只有一个root用户,修改root密码后选了MD5,提交后,重新
登陆出现“Host 'localhost' is not allowed to connect to this MySQL server..."
尝试另一个mysql库中的user表,覆盖,不行,估计是版本不同
解决:
编辑 my.ini

在[mysqld]的段中加上一句:skip-grant-tables

例如:
Java代码

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
skip-name-resolve
skip-grant-tables

目的是为了:

跳过MySQL的访问控制,任何人都可以在控制台以管理员的身份进入MySQL数据库。

需要注意的是在修改完密码以后要把MySQL服务器停掉重新启动才会生效

重启mysql服务!
bitsCN.com

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