问题描述:Mysql登录时提示Host "localhost " is not allowed to connect to mysql server
解决办法:
(1)首先停止mysql服务:sc stop mysql
(2)在mysql目录下的my.ini文件中[mysqld]下添加一行:skip-grant-tables
(3)使用命令提示框打开mysqld.exe并运行:mysqld --skip-grant-tables
(4)运行命令:grant all on *.* to 'root'@'%' identified by 'root密码';
(5)运行命令:flush privileges;
(6)重启mysql服务,问题解决。