首先在etc/mysql/conf.d中只有mysql.cnf 没有my.cnf 而且 mysql.cnf 为空
需要手动创建my.cnf放入etc/mysql目录下
[mysql]
[mysqld]
log-bin=/var/lib/mysql/mysql-bin
server-id=123
binlog_format = ROW
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
datadir = /var/lib/mysql
#log-error = /var/log/mysql/error.log
#bind-address = 127.0.0.1
symbolic-links=0
运行容器报错
World-writable config file ‘/etc/mysql/my.cnf’ is ignored.
原因是在windows系统中的映射文件 my.cnf权限过高
因此需要调低权限,只允许用户读取。