Docker启动mysql镜像命令
docker run -p 12345:3306 --name mysql -v /Users/zhangqiang/Docker/project/Base/mysql/conf:/etc/mysql/conf.d -v /Users/zhangqiang/Docker/project/Base/mysql/logs:/logs -v /Users/zhangqiang/Docker/project/Base/mysql/data:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=123456 -d mysql:5.6
Docker进入mysql容器命令
docker exec -it 3ff47bd494c2 /bin/bash
将mysql的数据备份到宿主机上
docker exec -it 3ff47bd494c2 sh -c ' exec mysqldump --all-databases -uroot -p "123456"' > /Users/zhangqiang/Docker/project/Base/mysql/all.databases.sql