docker-library / mysql

Docker Official Image packaging for MySQL Community Server
https://dev.mysql.com/
GNU General Public License v2.0
2.47k stars 2.2k forks source link

mysqld: Can't get stat of '/etc/mysql/conf.d/mysql-hrm.cnf' (OS errno 13 - Permission denied) #997

Closed ningObito closed 1 year ago

ningObito commented 1 year ago

installed mysql 8.0.33 on CentOS 7.3.1611(core) host

image

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

docker run --name mysql-test -v /opt/esm/hrm/conf/mysql:/etc/mysql/conf.d  --network host mysql:8.0.34     

2021-03-17T15:49:00.133821Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-03-17T15:49:00.246360Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2021-03-17T15:49:01.411241Z 0 [ERROR] [MY-011300] [Server] Plugin mysqlx reported: 'Setup of bind-address: '*' port: 33060 failed, `bind()` failed with error: Address already in use (98). Do you already have another mysqld server running with Mysqlx ?'
2021-03-17T15:49:01.411284Z 0 [ERROR] [MY-013597] [Server] Plugin mysqlx reported: 'Value '*' set to `Mysqlx_bind_address`, X Plugin can't bind to it. Skipping this value.'
2021-03-17T15:49:01.742686Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2021-03-17T15:49:01.742725Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2021-03-17T15:49:01.743350Z 0 [ERROR] [MY-010262] [Server] Can't start server: Bind on TCP/IP port: Address already in use
2021-03-17T15:49:01.743367Z 0 [ERROR] [MY-010257] [Server] Do you already have another mysqld server running on port: 3306 ?
2021-03-17T15:49:01.743380Z 0 [ERROR] [MY-010119] [Server] Aborting
2021-03-17T15:49:03.274248Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.34)  MySQL Community Server - GPL.
mysqld: Can't get stat of '/etc/mysql/conf.d/mysql-hrm.cnf' (OS errno 13 - Permission denied)
mysqld: [ERROR] Stopped processing the 'includedir' directive in file /etc/my.cnf at line 36.
2021-03-17T15:49:07.045617Z 0 [Warning] [MY-011068] [Server] The syntax '--skip-host-cache' is deprecated and will be removed in a future release. Please use SET GLOBAL host_cache_size=0 instead.
2021-03-17T15:49:07.047408Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.34) starting as process 1
2021-03-17T15:49:07.054059Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-03-17T15:49:07.156904Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2021-03-17T15:49:08.245203Z 0 [ERROR] [MY-011300] [Server] Plugin mysqlx reported: 'Setup of bind-address: '*' port: 33060 failed, `bind()` failed with error: Address already in use (98). Do you already have another mysqld server running with Mysqlx ?'
2021-03-17T15:49:08.245242Z 0 [ERROR] [MY-013597] [Server] Plugin mysqlx reported: 'Value '*' set to `Mysqlx_bind_address`, X Plugin can't bind to it. Skipping this value.'
2021-03-17T15:49:08.328889Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2021-03-17T15:49:08.328936Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2021-03-17T15:49:08.329639Z 0 [ERROR] [MY-010262] [Server] Can't start server: Bind on TCP/IP port: Address already in use
2021-03-17T15:49:08.329657Z 0 [ERROR] [MY-010257] [Server] Do you already have another mysqld server running on port: 3306 ?
2021-03-17T15:49:08.329670Z 0 [ERROR] [MY-010119] [Server] Aborting
2021-03-17T15:49:09.866936Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.34)  MySQL Community Server - GPL.
mysqld: Can't get stat of '/etc/mysql/conf.d/mysql-hrm.cnf' (OS errno 13 - Permission denied)
mysqld: [ERROR] Stopped processing the 'includedir' directive in file /etc/my.cnf at line 36.
2021-03-17T15:49:16.910776Z 0 [Warning] [MY-011068] [Server] The syntax '--skip-host-cache' is deprecated and will be removed in a future release. Please use SET GLOBAL host_cache_size=0 instead.
2021-03-17T15:49:16.912367Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.34) starting as process 1
2021-03-17T15:49:16.922898Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-03-17T15:49:18.601689Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2021-03-17T15:49:19.692473Z 0 [ERROR] [MY-011300] [Server] Plugin mysqlx reported: 'Setup of bind-address: '*' port: 33060 failed, `bind()` failed with error: Address already in use (98). Do you already have another mysqld server running with Mysqlx ?'
2021-03-17T15:49:19.692511Z 0 [ERROR] [MY-013597] [Server] Plugin mysqlx reported: 'Value '*' set to `Mysqlx_bind_address`, X Plugin can't bind to it. Skipping this value.'
2021-03-17T15:49:19.783598Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2021-03-17T15:49:19.783634Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2021-03-17T15:49:19.784254Z 0 [ERROR] [MY-010262] [Server] Can't start server: Bind on TCP/IP port: Address already in use
2021-03-17T15:49:19.784268Z 0 [ERROR] [MY-010257] [Server] Do you already have another mysqld server running on port: 3306 ?
2021-03-17T15:49:19.784280Z 0 [ERROR] [MY-010119] [Server] Aborting
2021-03-17T15:49:21.308747Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.34)  MySQL Community Server - GPL.
mysqld: Can't get stat of '/etc/mysql/conf.d/mysql-hrm.cnf' (OS errno 13 - Permission denied)
mysqld: [ERROR] Stopped processing the 'includedir' directive in file /etc/my.cnf at line 36.
2021-03-17T15:49:34.654949Z 0 [Warning] [MY-011068] [Server] The syntax '--skip-host-cache' is deprecated and will be removed in a future release. Please use SET GLOBAL host_cache_size=0 instead.
2021-03-17T15:49:34.656072Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.34) starting as process 1
2021-03-17T15:49:34.662671Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-03-17T15:49:34.982368Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2021-03-17T15:49:36.085282Z 0 [ERROR] [MY-011300] [Server] Plugin mysqlx reported: 'Setup of bind-address: '*' port: 33060 failed, `bind()` failed with error: Address already in use (98). Do you already have another mysqld server running with Mysqlx ?'
2021-03-17T15:49:36.085326Z 0 [ERROR] [MY-013597] [Server] Plugin mysqlx reported: 'Value '*' set to `Mysqlx_bind_address`, X Plugin can't bind to it. Skipping this value.'
2021-03-17T15:49:36.173994Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2021-03-17T15:49:36.174032Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2021-03-17T15:49:36.174683Z 0 [ERROR] [MY-010262] [Server] Can't start server: Bind on TCP/IP port: Address already in use
2021-03-17T15:49:36.174698Z 0 [ERROR] [MY-010257] [Server] Do you already have another mysqld server running on port: 3306 ?
2021-03-17T15:49:36.174710Z 0 [ERROR] [MY-010119] [Server] Aborting
2021-03-17T15:49:37.699586Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.34)  MySQL Community Server - GPL.
mysqld: Can't get stat of '/etc/mysql/conf.d/mysql-hrm.cnf' (OS errno 13 - Permission denied)
mysqld: [ERROR] Stopped processing the 'includedir' directive in file /etc/my.cnf at line 36.
2021-03-17T15:50:05.319907Z 0 [Warning] [MY-011068] [Server] The syntax '--skip-host-cache' is deprecated and will be removed in a future release. Please use SET GLOBAL host_cache_size=0 instead.
2021-03-17T15:50:05.321016Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.34) starting as process 1
2021-03-17T15:50:05.327503Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-03-17T15:50:06.088101Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2021-03-17T15:50:07.177453Z 0 [ERROR] [MY-011300] [Server] Plugin mysqlx reported: 'Setup of bind-address: '*' port: 33060 failed, `bind()` failed with error: Address already in use (98). Do you already have another mysqld server running with Mysqlx ?'
2021-03-17T15:50:07.177487Z 0 [ERROR] [MY-013597] [Server] Plugin mysqlx reported: 'Value '*' set to `Mysqlx_bind_address`, X Plugin can't bind to it. Skipping this value.'
2021-03-17T15:50:07.272437Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2021-03-17T15:50:07.272467Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2021-03-17T15:50:07.273125Z 0 [ERROR] [MY-010262] [Server] Can't start server: Bind on TCP/IP port: Address already in use
2021-03-17T15:50:07.273134Z 0 [ERROR] [MY-010257] [Server] Do you already have another mysqld server running on port: 3306 ?
2021-03-17T15:50:07.273147Z 0 [ERROR] [MY-010119] [Server] Aborting
2021-03-17T15:50:09.216178Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.34)  MySQL Community Server - GPL.
mysqld: Can't get stat of '/etc/mysql/conf.d/mysql-hrm.cnf' (OS errno 13 - Permission denied)
mysqld: [ERROR] Stopped processing the 'includedir' directive in file /etc/my.cnf at line 36.
2021-03-17T15:51:04.460274Z 0 [Warning] [MY-011068] [Server] The syntax '--skip-host-cache' is deprecated and will be removed in a future release. Please use SET GLOBAL host_cache_size=0 instead.
2021-03-17T15:51:04.461474Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.34) starting as process 1
2021-03-17T15:51:04.468480Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-03-17T15:51:04.775908Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2021-03-17T15:51:05.877541Z 0 [ERROR] [MY-011300] [Server] Plugin mysqlx reported: 'Setup of bind-address: '*' port: 33060 failed, `bind()` failed with error: Address already in use (98). Do you already have another mysqld server running with Mysqlx ?'
2021-03-17T15:51:05.877581Z 0 [ERROR] [MY-013597] [Server] Plugin mysqlx reported: 'Value '*' set to `Mysqlx_bind_address`, X Plugin can't bind to it. Skipping this value.'
2021-03-17T15:51:05.987250Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2021-03-17T15:51:05.987290Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2021-03-17T15:51:05.987910Z 0 [ERROR] [MY-010262] [Server] Can't start server: Bind on TCP/IP port: Address already in use
2021-03-17T15:51:05.987924Z 0 [ERROR] [MY-010257] [Server] Do you already have another mysqld server running on port: 3306 ?
2021-03-17T15:51:05.987936Z 0 [ERROR] [MY-010119] [Server] Aborting
2021-03-17T15:51:07.807665Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.34)  MySQL Community Server - GPL.
mysqld: Can't get stat of '/etc/mysql/conf.d/mysql-hrm.cnf' (OS errno 13 - Permission denied)
mysqld: [ERROR] Stopped processing the 'includedir' directive in file /etc/my.cnf at line 36.
2021-03-17T15:52:08.414772Z 0 [Warning] [MY-011068] [Server] The syntax '--skip-host-cache' is deprecated and will be removed in a future release. Please use SET GLOBAL host_cache_size=0 instead.
2021-03-17T15:52:08.416593Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.34) starting as process 1
2021-03-17T15:52:08.423308Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-03-17T15:52:08.739091Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2021-03-17T15:52:09.842238Z 0 [ERROR] [MY-011300] [Server] Plugin mysqlx reported: 'Setup of bind-address: '*' port: 33060 failed, `bind()` failed with error: Address already in use (98). Do you already have another mysqld server running with Mysqlx ?'
2021-03-17T15:52:09.842277Z 0 [ERROR] [MY-013597] [Server] Plugin mysqlx reported: 'Value '*' set to `Mysqlx_bind_address`, X Plugin can't bind to it. Skipping this value.'
2021-03-17T15:52:09.926565Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2021-03-17T15:52:09.926602Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2021-03-17T15:52:09.927223Z 0 [ERROR] [MY-010262] [Server] Can't start server: Bind on TCP/IP port: Address already in use
2021-03-17T15:52:09.927236Z 0 [ERROR] [MY-010257] [Server] Do you already have another mysqld server running on port: 3306 ?
2021-03-17T15:52:09.927249Z 0 [ERROR] [MY-010119] [Server] Aborting
2021-03-17T15:52:11.451243Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.34)  MySQL Community Server - GPL.
mysqld: Can't get stat of '/etc/mysql/conf.d/mysql-hrm.cnf' (OS errno 13 - Permission denied)
mysqld: [ERROR] Stopped processing the 'includedir' directive in file /etc/my.cnf at line 36.
2021-03-17T15:53:12.005909Z 0 [Warning] [MY-011068] [Server] The syntax '--skip-host-cache' is deprecated and will be removed in a future release. Please use SET GLOBAL host_cache_size=0 instead.
2021-03-17T15:53:12.007049Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.34) starting as process 1
2021-03-17T15:53:12.013456Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-03-17T15:53:15.036480Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2021-03-17T15:53:16.130492Z 0 [ERROR] [MY-011300] [Server] Plugin mysqlx reported: 'Setup of bind-address: '*' port: 33060 failed, `bind()` failed with error: Address already in use (98). Do you already have another mysqld server running with Mysqlx ?'
2021-03-17T15:53:16.130528Z 0 [ERROR] [MY-013597] [Server] Plugin mysqlx reported: 'Value '*' set to `Mysqlx_bind_address`, X Plugin can't bind to it. Skipping this value.'
2021-03-17T15:53:16.262654Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2021-03-17T15:53:16.262693Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2021-03-17T15:53:16.263474Z 0 [ERROR] [MY-010262] [Server] Can't start server: Bind on TCP/IP port: Address already in use
2021-03-17T15:53:16.263490Z 0 [ERROR] [MY-010257] [Server] Do you already have another mysqld server running on port: 3306 ?
2021-03-17T15:53:16.263503Z 0 [ERROR] [MY-010119] [Server] Aborting
2021-03-17T15:53:17.843481Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.34)  MySQL Community Server - GPL.
mysqld: Can't get stat of '/etc/mysql/conf.d/mysql-hrm.cnf' (OS errno 13 - Permission denied)
mysqld: [ERROR] Stopped processing the 'includedir' directive in file /etc/my.cnf at line 36.
2021-03-17T15:54:18.452142Z 0 [Warning] [MY-011068] [Server] The syntax '--skip-host-cache' is deprecated and will be removed in a future release. Please use SET GLOBAL host_cache_size=0 instead.
2021-03-17T15:54:18.453901Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.34) starting as process 1
2021-03-17T15:54:18.460301Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-03-17T15:54:18.971119Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2021-03-17T15:54:20.063119Z 0 [ERROR] [MY-011300] [Server] Plugin mysqlx reported: 'Setup of bind-address: '*' port: 33060 failed, `bind()` failed with error: Address already in use (98). Do you already have another mysqld server running with Mysqlx ?'
2021-03-17T15:54:20.063186Z 0 [ERROR] [MY-013597] [Server] Plugin mysqlx reported: 'Value '*' set to `Mysqlx_bind_address`, X Plugin can't bind to it. Skipping this value.'
2021-03-17T15:54:20.174884Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2021-03-17T15:54:20.174922Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2021-03-17T15:54:20.175554Z 0 [ERROR] [MY-010262] [Server] Can't start server: Bind on TCP/IP port: Address already in use
2021-03-17T15:54:20.175567Z 0 [ERROR] [MY-010257] [Server] Do you already have another mysqld server running on port: 3306 ?
2021-03-17T15:54:20.175579Z 0 [ERROR] [MY-010119] [Server] Aborting
2021-03-17T15:54:21.700753Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.34)  MySQL Community Server - GPL.
mysqld: Can't get stat of '/etc/mysql/conf.d/mysql-hrm.cnf' (OS errno 13 - Permission denied)
mysqld: [ERROR] Stopped processing the 'includedir' directive in file /etc/my.cnf at line 36.
2021-03-17T15:55:22.326832Z 0 [Warning] [MY-011068] [Server] The syntax '--skip-host-cache' is deprecated and will be removed in a future release. Please use SET GLOBAL host_cache_size=0 instead.
2021-03-17T15:55:22.327950Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.34) starting as process 1
2021-03-17T15:55:22.335095Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-03-17T15:55:22.717955Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2021-03-17T15:55:23.810321Z 0 [ERROR] [MY-011300] [Server] Plugin mysqlx reported: 'Setup of bind-address: '*' port: 33060 failed, `bind()` failed with error: Address already in use (98). Do you already have another mysqld server running with Mysqlx ?'
2021-03-17T15:55:23.810362Z 0 [ERROR] [MY-013597] [Server] Plugin mysqlx reported: 'Value '*' set to `Mysqlx_bind_address`, X Plugin can't bind to it. Skipping this value.'
2021-03-17T15:55:23.905858Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2021-03-17T15:55:23.905896Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2021-03-17T15:55:23.906527Z 0 [ERROR] [MY-010262] [Server] Can't start server: Bind on TCP/IP port: Address already in use
2021-03-17T15:55:23.906544Z 0 [ERROR] [MY-010257] [Server] Do you already have another mysqld server running on port: 3306 ?
2021-03-17T15:55:23.906555Z 0 [ERROR] [MY-010119] [Server] Aborting
2021-03-17T15:55:25.432169Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.34)  MySQL Community Server - GPL.
mysqld: Can't get stat of '/etc/mysql/conf.d/mysql-hrm.cnf' (OS errno 13 - Permission denied)
mysqld: [ERROR] Stopped processing the 'includedir' directive in file /etc/my.cnf at line 36.
2021-03-17T15:56:27.629888Z 0 [Warning] [MY-011068] [Server] The syntax '--skip-host-cache' is deprecated and will be removed in a future release. Please use SET GLOBAL host_cache_size=0 instead.
2021-03-17T15:56:27.631061Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.34) starting as process 1
2021-03-17T15:56:27.637639Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-03-17T15:56:28.482904Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2021-03-17T15:56:29.577529Z 0 [ERROR] [MY-011300] [Server] Plugin mysqlx reported: 'Setup of bind-address: '*' port: 33060 failed, `bind()` failed with error: Address already in use (98). Do you already have another mysqld server running with Mysqlx ?'
2021-03-17T15:56:29.577566Z 0 [ERROR] [MY-013597] [Server] Plugin mysqlx reported: 'Value '*' set to `Mysqlx_bind_address`, X Plugin can't bind to it. Skipping this value.'
2021-03-17T15:56:29.733700Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2021-03-17T15:56:29.733736Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2021-03-17T15:56:29.734377Z 0 [ERROR] [MY-010262] [Server] Can't start server: Bind on TCP/IP port: Address already in use
2021-03-17T15:56:29.734392Z 0 [ERROR] [MY-010257] [Server] Do you already have another mysqld server running on port: 3306 ?
2021-03-17T15:56:29.734404Z 0 [ERROR] [MY-010119] [Server] Aborting
2021-03-17T15:56:31.347730Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.34)  MySQL Community Server - GPL.

mysql-hrm.cnf file permission image

mysql user in host image

how to solve the probelm?

LaurentGoderre commented 1 year ago

The uid:gidfor 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
yosifkit commented 1 year ago

⬆️ 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.

ningObito commented 1 year ago

@yosifkit thank for your help, adding read and execute permissions to the /opt/esm/hrm/conf/mysql directory and solve the problem.