Closed ningObito closed 1 year ago
The uid:gid
for the mysql
user inside the container is 999:999
so it doesn't match with your local one. Could you try to create a group on your host with id 999 then assign that group to your folder /opt/esm/hrm/conf/mysql
and give the group the same permission as the user?
ex:
groupadd -g 1010 mysql-container
chown -R :mysql-container /opt/esm/hrm/conf/mysql
⬆️ technically you can just chown your config files (and the directory) to user/group id 999 without creating a user or group. I think just adding read and execute permissions to the /opt/esm/hrm/conf/mysql
directory for everyone could be enough.
Alternatively, if you provide a volume writeable by user/group 27
, then you can run the mysql
container as that user:
$ docker run --user 27:27 -v /path/to/data/dir:/var/lib/mysql -v ... mysql:8.0.34
You should probably drop --network host
or set custom ports in the cnf
files as the ports used by mysql
in the container are conflicting with the MySQL installed on the host.
@yosifkit thank for your help, adding read and execute permissions to the /opt/esm/hrm/conf/mysql directory and solve the problem.
installed mysql 8.0.33 on CentOS 7.3.1611(core) host
when running mysql docker container in same host, can't get stat of /etc/mysql/conf.d/mysql-hrm.cnf
docker image 8.0.34
run docker container command
mysql-hrm.cnf file permission
mysql user in host
how to solve the probelm?