I have a docker mysql image running, following is what the docker-compose.yml file looks like:
db:
image: mysql
environment:
MYSQL_ROOT_PASSWORD: \"\
A simple way to login to MySQL inside a Docker image is:
sudo docker exec -it <CONTAINER_ID> mysql -u root -p
for mySQL's root
account by default password is not set, its BLANK, just press enter/return key, unless you have changed root password.
On successful execution, above command gives you mysql prompt.
Cheers!