1.创建文件夹:
D:/mysql_workspace/mysql/etc/mysql/data (存储mysql的数据目录)
D:/mysql_workspace/mysql/etc/mysql/tmp (存储mysql的临时目录)
D:/mysql_workspace/mysql/opt/mysql/redolog (录事务具体操作内容)
D:/mysql_workspace/mysql/opt/mysql/undolog (用于事务回滚操作)
2.配置my.cnf文件放在D:/mysql_workspace/mysql/etc目录下
3.执行命令:
docker run -d -p 3306:3306 -v D:/mysql_workspace/mysql/etc/mysql:/etc/mysql -v D:/mysql_workspace/mysql/etc/my.cnf:/etc/my.cnf -v D:/mysql_workspace/mysql/opt/mysql:/opt/mysql -e MYSQL_ROOT_PASSWORD=123456 --name mysql5.7 mysql:5.7
4.登录:
mysql -u root -p 123456
标签:opt,5.7,cnf,etc,workspace,mysql,docker From: https://www.cnblogs.com/goPush/p/17121828.html