Get docker image
docker pull mysql:5.6
Mirror running mysql, mysql and specify the configuration
docker run -p 3306:3306 -v /Users/huangxiang/softData/docerData/mysql:/etc/mysql --name localmysql -e MYSQL_ROOT_PASSWORD=root -d mysql:5.6
Enter myql
docker exec -it localmysql bash
Landing mysql
mysql -uroot -p
Restart container created
docker start localmysql
The next time you need to restart the container, the original data can be loaded
mysql data on saving docker
Guess you like
Origin www.cnblogs.com/-1007813544/p/bao-cundocker-shang-demysql-shu-ju.html
Recommended
Ranking