修改配置文件:my.cnf  加上skip-grant-tables

重启mysql

mysql -uroot  登录  

mysql> USE mysql ; 
mysql> UPDATE user SET Password = password ( 'new-password' ) WHERE User = 'root' ; 
mysql> flush privileges ; 
mysql> quit

将配置文件改回来

相关文章:

  • 2021-12-27
  • 2021-08-01
  • 2021-10-26
  • 2021-09-18
  • 2022-03-03
猜你喜欢
  • 2022-01-15
  • 2021-10-14
  • 2022-12-23
  • 2021-08-15
  • 2021-08-10
  • 2021-12-23
  • 2022-02-10
相关资源
相似解决方案