如果忘记了MySQLroot用户密码可以如下操作(Linux下):

如果 MySQL 正在运行,首先杀之: killall -TERM mysqld。
启动 MySQL :bin/safe_mysqld --skip-grant-tables
就可以不需要密码就进入 MySQL 了
mysql -uroot
然后就是
>use mysql
>update user set password=password("new_pass") where user="root";
>flush privileges;
重新杀 MySQL ,用正常方法启动 MySQL 。

这个是我在别的地方找到的,是正确的方法。

相关文章:

  • 2021-07-21
  • 2022-02-28
  • 2022-12-23
  • 2021-12-13
  • 2022-12-23
  • 2021-10-09
  • 2021-10-24
  • 2021-07-11
猜你喜欢
  • 2022-01-14
  • 2021-11-06
  • 2022-12-23
  • 2021-12-04
  • 2021-05-29
  • 2021-12-23
  • 2022-01-29
相关资源
相似解决方案