查看密码
# 进入容器
docker exec -it 【容器ID】 /bin/bash
# 登录
mysql -uroot -p
# 输入密码
# 查看密码
select user,host,authentication_string from user;
修改root 密码
# 修改配置文件
vim /etc/my.cnf
# 添加 skip-grant-table
# 重启mysql
# 进入容器
docker exec -it 【容器ID】 /bin/bash
# 登录
mysql -uroot
# 修改密码
alter user'root'@'%' IDENTIFIED BY 'MyNewPass@123';