1.设置无密码登陆:

vim /etc/mysql/conf.d/docker.cnf

Docker下MySQL忘记密码解决方法

加上skip-grant-tables,这样不需要密码可以直接以root身份登录,然后重设密码

2、重置密码:

use mysql; update mysql.user set authentication_string=password('root') where User='root';

3、刷新权限:

flush privileges;

4、将配置信息该回1中截图所示
5、重启MySQL5、重启MySQL

相关文章:

  • 2021-11-23
  • 2022-12-23
  • 2021-11-28
  • 2021-10-07
  • 2022-02-10
猜你喜欢
  • 2021-05-05
  • 2022-12-23
  • 2022-12-23
  • 2021-06-07
  • 2021-07-05
  • 2021-06-23
  • 2021-10-31
相关资源
相似解决方案