Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MySQL binlog location has wrong user #3

Open
shinguz opened this issue Sep 1, 2017 · 2 comments
Open

MySQL binlog location has wrong user #3

shinguz opened this issue Sep 1, 2017 · 2 comments

Comments

@shinguz
Copy link

shinguz commented Sep 1, 2017

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

@ltangvald
Copy link

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)

@shinguz
Copy link
Author

shinguz commented Sep 1, 2017

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 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants