要修改Docker中MySQL的密码,可以按照以下步骤进行操作:
docker exec -it <mysql_container_name> bash
mysql -u root -p
ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password';
(将new_password
替换为你想要设置的新密码)
ALTER USER 'root'@'%' IDENTIFIED BY 'new_password';
exit
exit
现在你已经成功修改了Docker中MySQL的密码。