linux--linux--mysql登录错误--mysqladmin connect to server at 'localhost' failed

Linux–linux–mysql登录错误–mysqladmin: connect to server at ‘localhost’ failed

一、mysql登录错误(有关mysql密码登录问题都可用此方法重置密码解决)

mysqladmin: connect to server at ‘localhost’ failed
error: ‘Access denied for user ‘root’@‘localhost’ (using password: YES)’

解决办法:破解mysql密码

#> service mysqld stop
#>mysqld_safe --skip-grant-tables & mysql -uroot -p 回车进入
>use mysql;
> update user set password=PASSWORD(“123456”)where user=“root”;
更改密码为123456
> flush privileges; 更新权限
> quit 退出

service mysqld restart
mysql -uroot -p新密码进入

-------------本文结束感谢您的阅读-------------