ubuntu Mysql 密码修改

前端之家收集整理的这篇文章主要介绍了ubuntu Mysql 密码修改前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

1、结束当前正在运行的MysqL进程。

  1. # /etc/init.d/MysqL stop

2、用MysqL安全模式运行并跳过权限验证。

  1. # MysqLd_safe --skip-grant-tables & MysqL -uroot

3、修改root用户口令。

  1. use MysqL;
  2. //假设新密码:root
  3.  
  4. update user set password=PASSWORD('root') where User='root';
  5. //if(这句不行) 试下一句!
  6.  
  7. update MysqL.user set authentication_string=password('root') where user='root' ;

4.

  1. update user set plugin="MysqL_native_password";
  2. quit;

5.restart

  1. /etc/init.d/MysqL stop
  2. kill -9 $(pgrep MysqL)
  3. /etc/init.d/MysqL start

Done deal!

猜你在找的Ubuntu相关文章