Host 'localhost' is not allowed to connect to this MySQL server

Host 'localhost' is not allowed to connect to this MySQL server 解决方法


起因

   系统本来就装了Mysql5.5版本,后来又装了一个WAMP,里面又一个MySQL5.1的。切换使用多了,就产生了误操作。试了一下网上大多的方法,好像都不行。但后来找到了一个可行的方法。


方法

首先停止mysql服务:

sc stop mysql

123948317.jpg

   然后:

mysqld --skip-grant-tables

   另开一个终端,继续

mysqlcheck --check-upgrade --all-databases --auto-repair

124127774.jpg

   然后再输入
mysql

   就可以进入MySQL控制台了。现在可以修改mysql.user表了。


ps

如果这样还不行的话,只有重装MySQL了。j_0059.gif


你可能感兴趣的:(TO,TO,mysql,mysql,server,this,connect,host,allowed,is,not,'localhost')