I tried this
root@eramba:/etc/mysql# docker exec -it mysql bash
bash-4.4# mysql -u docker -p
Enter password:
ERROR 1045 (28000): Access denied for user ‘docker’@‘localhost’ (using password: YES)
Also tried connecting with root user, still getting the above error.
Please give me steps how to get mysql shell in this
Yes, MySQL passwords are only set during the initial docker-compose execution.
If you want to change them afterward, you need to update them directly in MySQL.
Reference: https://www.cyberciti.biz/faq/mysql-change-user-password/