"Host 'localhost' is not allowed to connect to this MySQL server" 的原因及解决办法
2015-01-10 14:52
961 查看
"Host 'localhost' is not allowed to connect to this MySQL server" 的原因及解决办法
(2010-11-29 16:02:36)转载▼
标签:杂谈 |
重装完毕后,发现MYSQL数据库密码为空,则update了 user表里的root密码,重新连接,发现出现"Host 'localhost' is not allowed to connect to this MySQL server" ,真是离奇的事情一件接一见
后来回想了一下发现,因为只是update了root,但是MYSQL是有个访问控制表,root的访问控制表未更新,就导致了无法访问mysql
网上找到的解决方法,应该是跳过该表就可以直接使用了,但是这个放在服务器上还是会有一定的风险,那就是任何人在任何地方都可以访问你的MYSQL,如果安全重要的话还是重新装一下数据库好了。
解决方法如下:
----------------------------------------
编辑 my.ini linux下为/etc/my.cnf
在[mysqld]的段中加上一句:skip-grant-tables
例如:
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
skip-name-resolve
skip-grant-tables
目的是为了:
跳过MySQL的访问控制,任何人都可以在控制台以管理员的身份进入MySQL数据库。
需要注意的是在修改完密码以后要把MySQL服务器停掉重新启动才会生效
重启mysql服务!
OK!
相关文章推荐
- "Host 'localhost' is not allowed to connect to this MySQL server" 的原因及解决办法
- "Host 'localhost' is not allowed to connect to this MySQL server" 的原因及解决办法
- mysql不支持远程连接的解决办法(#1130 - Host 'localhost' is not allowed to connect to this MySQL server)
- mysql不支持远程连接的解决办法(#1130 - Host 'localhost' is not allowed to connect to this MySQL server)
- jdbc连接mysql时报message from server: "Host '**' is not allowed to connect to this MySQL server"错误解决
- ERROR 1130 (HY000): Host 'xxxxxx' is not allowed to connect to this MySQL server解决办法
- 连接MySQL数据库报 "Host XXX.XXX.XXX.XXX is not allowed to connect to this MySQL server " 解决办法。
- message from server: "Host is not allowed to connect to this MySQL server"解决办法
- message from server: "Host is not allowed to connect to this MySQL server"解决办法
- 远程登录mysql,报错:message from server: "Host is not allowed to connect to this MySQL server"解决办法
- Host '*.*.*.*' is not allowed to connect to this MySQL server 解决办法
- mysql数据库 message from server: "Host is not allowed to connect to this MySQL server"解决办法
- Host 'localhost' is not allowed to connect to this MySQL server解决
- message from server: "Host 'xxx' is not allowed to connect to this MySQL server"
- E Host '192.168..' is not allowed to connect to this MySQL server 问题解决!
- Mariadb-Host '192.168.*.*' is not allowed to connect to this MariaDB server"的解决方法
- Host "localhost " is not allowed to connect to mysql server解决方法
- Host 'xxx' is not allowed to connect to this MySQL server的解决
- Mac OS mysql Host 'localhost' is not allowed to connect to this MySQL server
- IT忍者神龟之mysql远程连接:ERROR 1130 (HY000): Host '*.*.*.*' is not allowed to connect to this MySQL server解决