MySQL 绑定地址在 Docker 容器中

MySQL bind-address in a Docker container

我想构建一个容器,它可以绑定到多个 IP 地址。绑定地址存放在my.cnf,没问题。如何定义它或使用 Dockerfile 来授予远程访问权限?

sed is usually the weapon of choice for such tasks. Taken from the official mysql dockerfile:

RUN sed -Ei 's/^(bind-address|log)/#&/' /etc/mysql/my.cnf

命令在my.cnf或conf.d/*.

中注释掉以bind-addresslog开头的行