Question - docker usage commands

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

Hello,

Please try to follow our posting guides, next time.
Your credentials are setup in .env file.
Please refer to our documentation: Docker Install

Thanks Sam for your suggestion.

So, i tried the previous password with this below command it worked.

mysql -h mysql -u docker -p

we recomposed the docker again but it taking the previous password as DB Password.

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/