First step see docker state
systemctl status docker
The second step Search the image library for mysql
docker search mysql
Official version , Default latest
The third step is to pull the image
docker pull mysql
Step four Download successful
Step 5 check the image
Step six Create a folder , Check to see if there is mysql Boot or port usage
Step seven perform docker Deploy
docker run -id \
> -p 3306:3306 –name= mysql -v $PWD/conf.d : /etc/mysql/conf.d -v $ PWD/logs : /logs -v $PWD /data: /var/lib/mysql -e MYSQL_ROOT_PASSWORD=123456 mysql
I don’t know why I can’t write by myself
docker run -p 3306:3306 –name my-mysql -e MYSQL_ROOT_PASSWORD=123456 -d mysql
Step eight , Let go of linux port