mysql登录:access denied for user 'root'@'localhost'(using password:YES)

mysql登录:

access denied for user 'root'@'localhost'(using password:YES)

解决:
use mysql;
select user,host from user;

+------+---------------+
| user | host          |
+------+---------------+
| root | %             |
| root | 127.0.0.1     |
| root | ::1           |
|      | localhost     |
| root | localhost     | |
+------+---------------+

看到上面有user为空的记录,删掉它,重启mysql服务

 delete from user where user='';
 flush  privileges;
 quit;

参考 http://holy2010.blog.51cto.com/1086044/684117

posted @ 2017-09-12 22:46  walkingSun  阅读(214)  评论(0编辑  收藏  举报
**/