前端之家收集整理的这篇文章主要介绍了
ubuntu Mysql 密码修改,
前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
1、结束当前正在运行的MysqL进程。
- # /etc/init.d/MysqL stop
2、用MysqL安全模式运行并跳过权限验证。
- # MysqLd_safe --skip-grant-tables & MysqL -uroot
3、修改root用户口令。
- 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!