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

Can't create/write to file '/var/lib/mysql/is_writable' #1

Open
stevenmunro opened this issue Jan 21, 2019 · 3 comments
Open

Can't create/write to file '/var/lib/mysql/is_writable' #1

stevenmunro opened this issue Jan 21, 2019 · 3 comments

Comments

@stevenmunro
Copy link

I'm getting the following error in both docker-compose up and swarm mode for the percona-xtradb-cluster containers.

    Running --initialize-insecure on /var/lib/mysql/,
    total 4.0K,
    drwxr-xr-x 1 root root    0 Jan 21 21:21 .,
    drwxr-xr-x 1 root root 4.0K Jan  4 10:11 ..,
    mysqld: Can't create/write to file '/var/lib/mysql/is_writable' (Errcode: 13 - Permission denied),
    2019-01-21T21:22:44.144657Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. 
    Please use --explicit_defaults_for_timestamp server option (see documentation for more details).,
    2019-01-21T21:22:44.144775Z 0 [Warning] WSREP: Node is running in bootstrap/initialize mode. 
    Disabling pxc_strict_mode checks,
    2019-01-21T21:22:44.146614Z 0 [ERROR] --initialize specified but the data directory exists and is 
    not writable. Aborting.,
    2019-01-21T21:22:44.146694Z 0 [ERROR] Aborting,
@stevenmunro
Copy link
Author

It appears that the official docker images now run as the mysql user, not the root user.

Further information about the breaking change here

I'm currently searching for a solution.

@stevenmunro stevenmunro changed the title Error on percona-xtradb-cluster init Can't create/write to file '/var/lib/mysql/is_writable' Jan 21, 2019
@shudipta
Copy link

shudipta commented Nov 4, 2019

Same error from me when I use percona/percona-xtradb-cluster:5.7.25 as container image of a Statefulset in Kubernetes.

Need an urgent solution.

@alextesi
Copy link

alextesi commented Jan 6, 2022

Simply solution:

chown 1001:1001 /var/lib/mysql/ -R

It worked for me.
Let me know if it works for you.
Thanks
Alessandro

PS: i think we can close this issue!!

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

3 participants