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;