2.修改及查看账户。
USE mysql;
SELECT User, Host, plugin FROM user WHERE User = 'root';
3. 更新账户密码。
-- 更新 root@localhost 密码
ALTER USER 'root'@'localhost' IDENTIFIED WITH caching_sha2_password BY '新密码';
-- 更新 root@% 密码(远程访问账户)
ALTER USER 'root'@'%' IDENTIFIED WITH caching_sha2_password BY '新密码';
4. 更新。
FLUSH PRIVILEGES;
5. 重启。
docker restart 容器名或ID