$ docker pull mysql
pull mysql images
$ docker run --name noahmysql -e MYSQL_ROOT_PASSWORD=noahpassword -d mysql:tag
noahmysql = name you wnat to assign to your conctainer
noahpassword = the password to be set for the MySQL root user
tag = mysql version you want
$ docker exec -it noahmysql bash
bash = connect mysql on docker and mac-terminal
$ myql -uroot -p
enter password you set
$ show database;
will show databases in mysql
$ quit
MYSQL will be terminated
$ /# exit
getting back to yout own terminal
Reference