1.干掉mysqld进程

  kill -TERM mysqld

2.使用下面命令启动mysqld

  /usr/bin/mysqld_safe --skip-grant-tables &

3.新开一个命令窗口作为客户端连接mysql

         /usr/bin/mysql -uroot -p

     接着回车,以空密码进入

     use mysql;
              update user set password=password('yournewpasswordhere') where user='root';
              flush privileges;
              exit;

 4.杀死mysql,重启mysql  一切ok

相关文章:

  • 2022-02-10
  • 2021-11-28
  • 2022-12-23
  • 2022-12-23
  • 2022-01-05
  • 2021-11-19
  • 2021-06-25
  • 2021-10-10
猜你喜欢
  • 2021-11-23
  • 2022-12-23
  • 2021-12-04
  • 2021-04-25
  • 2022-12-23
  • 2021-08-08
  • 2021-09-25
相关资源
相似解决方案