首页 > 其他 > 详细

docker映射配置文件

时间:2021-08-30 00:29:58      阅读:15      评论:0      收藏:0      [点我收藏+]

1、创建一个my.cnf文件

[mysqld]
user=mysql
character-set-server=utf8
[client]
default-character-set=utf8
[mysql]
default-character-set=utf8

技术分享图片

 

 2、启动的时候指定配置文件

--mount方式:

--mount type=bind,src=/mysql/conf/my.cnf,dst=/etc/my.cnf

-v方式

-v /mysql/conf/my.cnf:/etc/my.cnf
sudo docker run -p 3306:3306 -e TZ="Asia/Shanghai" --name mysql --privileged=true --mount type=bind,src=/mysql/conf/my.cnf,dst=/etc/my.cnf --mount type=bind,src=/mysql/logs,dst=/var/log/mysql --mount type=bind,src=/mysql/data,dst=/var/lib/mysql -e MYSQL_ROOT_PASSWORD=123456 -d mysql:5.7

 

技术分享图片

 

docker映射配置文件

原文:https://www.cnblogs.com/weibanggang/p/15195659.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!