MySQL binlog location has wrong user
Hello Mark
We are currently playing around with Enterprise Docker images.
When I am enabling the binary log outside of datadir (/var/log/mysql) start of container fails with permission denied because directory belongs to user root. I wanted to use the docker-entrypoint-initdb.d hock but at that stage this is too late.
The last idea is to patch entrypoint.sh and add chown -R mysql: "${MYSQL_BINLOG_DIR}"
I would like to see something like this from upstream.
Regars, Oli
Right. Currently the entrypoint script only tries to ensure correct ownership of datadir. We can't account for every config customization, though we could add checks for some of the major ones, like binary logging.
The best overall solution is probably to better explain the docker-entrypoint-initdb.d system in our docs (which we are working on rewriting)
Seems to work like this:
docker cp masteroli1:/entrypoint.sh entrypoint.sh grep -n -m 1 chown entrypoint.sh
add after
sed -i '51i chown -R mysql: "${MYSQL_BINLOG_DIR}"' entrypoint.sh
Then build new image.
./Dockerfile
FROM store/oracle/mysql-enterprise-server:5.7 ADD ./entrypoint.sh /entrypoint.sh
docker build --tag mysql-enterprise-server-binlog:5.7.19 .