赞
踩
docker pull mysql:5.7
--- 启动容器
docker run -d -p 3306:3306 --name mysql -e MYSQL_ROOT_PASSWORD=123456 mysql:5.7
--- 进入mysql
docker exec -it mysql bash
---输入账号密码
mysql -uroot -p
---查看数据存储目录
show variables like '%datadir%';
docker cp mysql:/etc/mysql /usr/local/mysql/conf
docker stop mysql
docker rm mysql
docker run -d -p 3306:3306 --privileged=true --name mysql -v /usr/local/mysql/conf:/etc/mysql -v /usr/local/mysql/data:/var/lib/mysql/ -e MYSQL_ROOT_PASSWORD=123456 --restart always mysql:5.7
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。