在my.ini的[mysqld]字段加入:
skip-grant-tables
重启mysql服务,这时的mysql不需要密码即可登录数据库
然后进入mysql
mysql>use mysql;
mysql>更新 update user set password=password('新密码') WHERE User='root';
mysql>flush privileges;
运行之后最后去掉my.ini中的skip-grant-tables,重启mysqld即可。

相关文章:

  • 2022-12-23
  • 2022-01-12
  • 2021-06-24
  • 2022-12-23
  • 2021-12-04
  • 2021-12-19
  • 2022-12-23
  • 2021-10-28
猜你喜欢
  • 2021-07-27
  • 2021-07-10
  • 2022-12-23
  • 2021-12-04
  • 2021-08-08
  • 2021-12-30
相关资源
相似解决方案