1、结束当前正在运行的MysqL进程。
# /etc/init.d/MysqL stop
2、用MysqL安全模式运行并跳过权限验证。
# MysqLd_safe --skip-grant-tables & MysqL -uroot
use MysqL;
//假设新密码:root
update user set password=PASSWORD('root') where User='root';
//if(这句不行) 试下一句!
update MysqL.user set authentication_string=password('root') where user='root' ;
4.
update user set plugin="MysqL_native_password";
quit;
5.restart
/etc/init.d/MysqL stop
kill -9 $(pgrep MysqL)
/etc/init.d/MysqL start
Done deal!