首页 > 解决方案 > Ubuntu 上 Docker 中的 MySQL:警告:全局可写配置文件被忽略

问题描述

根据https://dev.mysql.com/doc/refman/8.0/en/option-files.html ,在我的/etc/mysql/my.cnf中,我有: 已!includedir /etc/mysql/mysql.conf.d配置,并且我认为my.cnf我的!includedir目录中的文件应该覆盖。/etc/mysql/my.cnf

但是我World-writable config file /etc/mysql/mysql.conf.d/my.cnf is ignored在重启我的mysql服务器时收到了警告,并确认我的那个my.cnf文件中的配置!includedir不起作用。为什么会发生警告,以及如何使其工作?

语境:

Docker 中的 Ubuntu 16.04.3,mysql 5.7.22

笔记:

我知道如果我的cnf文件包含多个点 if 可能不起作用:

https://serverfault.com/questions/918530/mysql-includedir-not-working

但我不认为我遇到了这个问题。

标签: javamysqldocker

解决方案


请您的管理员修复权限,上游很好:

$ docker run mysql find /etc/mysql -ls
Unable to find image 'mysql:latest' locally
latest: Pulling from library/mysql
a5a6f2f73cd8: Pull complete 
936836019e67: Pull complete 
283fa4c95fb4: Pull complete 
1f212fb371f9: Pull complete 
e2ae0d063e89: Pull complete 
5ed0ae805b65: Pull complete 
0283dc49ef4e: Pull complete 
a7e1170b4fdb: Pull complete 
88918a9e4742: Pull complete 
241282fa67c2: Pull complete 
b0fecf619210: Pull complete 
bebf9f901dcc: Pull complete 
Digest: sha256:b7f7479f0a2e7a3f4ce008329572f3497075dc000d8b89bac3134b0fb0288de8
Status: Downloaded newer image for mysql:latest
  4225047      0 drwxr-xr-x   3 root     root           57 Nov 16 01:12 /etc/mysql
  6324293      0 drwxrwxr-x   2 root     root           41 Nov 16 01:10 /etc/mysql/conf.d
  6324294      4 -rw-r--r--   1 root     root         1294 Oct  7 09:13 /etc/mysql/conf.d/mysql.cnf
  6324308      4 -rw-rw-r--   1 root     root           43 Nov 16 01:10 /etc/mysql/conf.d/docker.cnf
  4225049      4 -rw-r--r--   1 root     root         1469 Oct  7 09:13 /etc/mysql/my.cnf.fallback
  4225048      4 -rw-rw-r--   1 root     root         1174 Nov 16 01:10 /etc/mysql/my.cnf

推荐阅读