To serve a MySQL server in a docker container, run the following command.
$ docker-compose up -d
Run the following command.
(Only if you have installed MySQL client.)
$ mysql -h 127.0.0.1 -uroot -proot
Or login the docker container and run mysql command.
$ docker exec -it ${CONTAINER-ID} bash
/# mysql -uroot -proot