compose mysql_使用docker-compose来创建一个MySQL模式/数据库

Using a custom MySQL configuration file The MySQL startup

configuration is specified in the file /etc/mysql/my.cnf, and that

file in turn includes any files found in the /etc/mysql/conf.d

directory that end with .cnf. Settings in files in this directory will

augment and/or override settings in /etc/mysql/my.cnf. If you want to

use a customized MySQL configuration, you can create your alternative

configuration file in a directory on the host machine and then mount

that directory location as /etc/mysql/conf.d inside the mysql

container.

If /my/custom/config-file.cnf is the path and name of your custom

configuration file, you can start your mysql container like this (note

that only the directory path of the custom config file is used in this

command):

$docker run –name some-mysql -v /my/custom:/etc/mysql/conf.d -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql:tag This will start a new container some-mysql where the MySQL instance uses the combined startup settings from /etc/mysql/my.cnf and /etc/mysql/conf.d/config-file.cnf, with settings from the latter taking precedence.

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值