However, the Mysql container stops with the following error:
Can't start server: can't create PID file: Permission denied
[ERROR] [MY-013129] [Server] A message intended for a client cannot be sent there as no client-session is attached. Therefore, we're sending the information to the error-log instead: MY-000001 - Can't create/write to file '/var/run/mysqld/mysqld.pid' (OS errno 13 - Permission denied)
[ERROR] [MY-010092] [Server] Can't start server: can't create PID file: Permission denied
I have tried both following hashes (that I found on Docker Hub), but the outcome was the same:
Hello @imriss ,
I just pulled the latest percona:8 sha256:ffd7a2cfedf02d49e812e85383c0dbaf265255adf30a954feaddb4d38d48ddfa
and it started without issue.
$ docker run -e MYSQL_ROOT_PASSWORD=Percona1234 percona:8
...
2021-07-06T17:46:45.540771Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.23-14' socket: '/var/lib/mysql/mysql.sock' port: 3306 Percona Server (GPL), Release 14, Revision 3558242.
Hello @matthewb , thank you, and sorry I missed your reply.
I agree that the docker image works fine by itself.
For my case, I am using it as part of Presslabs Mysql Operator. It seems that they run the docker image under the “mysql” user, not root. For Percona versions lower or equal to 8.0.19, there is no issues. However, for version higher than 8.0.19, it seems that it needs some kind of root level access, and the deployment under Presslabs Mysql Operator fails.
I would like to see if there is any workarounds. The error message is:
You would need to have some way to launch the container with appropriate permissions. MySQL is always started as the root user and then is forked to run under the mysql user.
For that particular error, I would change the PID location. Create/edit a mysql config and add the following:
[mysql.server]
pid-file=/tmp/mysql.pid
See if that helps get around the permissions issue