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

首先停用mysql服务

Service mysql stop

然后用此命令跳过网络授权表 mysqld_safe --user=mysql --skip-grant-tables --skip-networking & 

登录mysql

Mysql –uroot –p


Mysql 密码修改

mysql>use mysql;

      mysql>update user set password=password('new_password') where user='用户名';

      mysql>flush privileges;