D
D
Dmitry Tarasov2021-09-29 10:10:46
Windows
Dmitry Tarasov, 2021-09-29 10:10:46

How to fix problem with World-writable config file '/etc/mysql/my.cnf' is ignored?

Hello! There is a docker compose and there is a database section, it looks like this:

db:
    platform: linux/x86_64
    image: mysql:latest
    ports:
      - '${DB_PORT}:3306'
    environment:
      MYSQL_ROOT_PASSWORD: '${MYSQL_ROOT_PASSWORD}'
      MYSQL_DATABASE: '${MYSQL_DATABASE}'
      MYSQL_USER: '${MYSQL_USER}'
      MYSQL_PASSWORD: '${MYSQL_PASSWORD}'
    volumes:
      - './docker/mysql/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d'
      - './docker/mysql/db_data:/var/lib/mysql'
      - './docker/mysql/my.cnf:/etc/mysql/my.cnf'
      - './docker/logs/mysql:/var/log/mysql'


When running, the logs have this error, and only on windows
mysqld: [Warning] World-writable config file '/etc/mysql/my.cnf' is ignored.

And macos works great!

googled, they are asked to change the access rights, which they have not already set, it does not help.
The entire project is located on the C drive.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Karabanov, 2021-09-29
@fast-je

Write permissions allow everyone to change the config.
And you need to give such rights so that only root can make changes to the config

D
Dmitry Shitskov, 2021-09-29
@Zarom

You can try like this
- './docker/mysql/my.cnf:/etc/mysql/my.cnf:ro'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question