Fork me on GitHub

Docker mysql忘记密码怎么办?

 

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

再上面文件添加下面这一句

skip-grant-tables

UPDATE user SET authentication_string="" WHERE user="root";


flush privileges;

重启

 

skip-grant-tables  删除


mysql -uroot -p

alter user 'root' identified by 'root';

flush privileges;

posted @ 2022-07-29 17:25  爱悟空  阅读(512)  评论(0编辑  收藏  举报