I have followed the instruction in https://registry.hub.docker.com/_/mysql/ to pull an image and running a container in which it runs a MySQL server.
The container is run
First bash into your mysql container
docker exec -it mysql-container-name bash
Then within the container connect to mysql to run your commands
mysql -u root -p
Then you are able to run mysql queries.