MySql数据库:Host 'localhost' is not allowed to connect to this MySQL server

最近在IDEA中开发Web项目时,连接MYSQL数据库,出现问题:Access denied for user 'root'@'localhost'(using password:YES)。

 网上查找后发现需要修改MySQL的密码。

 修改MYSQL的root密码后,出现Host 'localhost' is not allowed to connect to this MySQL server 错误。

解决办法:

C:\Program Files\MySQL\MySQL Server 5.5\my.ini

在最后添加两行,

skip-name-resolve
skip-grant-tables

重启MySQL服务即可。

猜你喜欢

转载自www.cnblogs.com/ktcorete/p/9987009.html