MySQL !includedir 不工作

kae*_*ael 6 mysql

这是我遇到并解决的问题的文档。

\n\n

我尝试使用 MySQL\xe2\x80\x99s!includedir指令将文件包含在conf.d目录中,但 \xe2\x80\x99s 不起作用。我尝试搞乱权限和一切。这是我的配置树:

\n\n
/etc/mysql\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 conf.d\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 mysql.cnf\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 mysqldump.cnf\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 my.cnf\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 my.cnf.local\n\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 my.cnf.fallback\n
Run Code Online (Sandbox Code Playgroud)\n\n

和我的my.cnf

\n\n
[client]\nport        = 3306\n\n[mysqld]\nlocal-infile = 0 \nport        = 3306\nserver-id   = 1 \n# more stuff.....\n\n[mysqldump]\nquick\nmax_allowed_packet = 16M \n\n[mysql]\nno-auto-rehash\n\n[myisamchk]\nkey_buffer_size = 20M \nsort_buffer_size = 20M \nread_buffer = 2M\nwrite_buffer = 2M\n\n[mysqlhotcopy]\ninteractive-timeout\n\n!include /etc/mysql/my.cnf.local\n
Run Code Online (Sandbox Code Playgroud)\n\n

但是,/etc/mysql/my.cnf.local未加载指定的文件。解决方法见下文......

\n

kae*_*ael 6

事实证明,除了要求(and ).cnf中的文件有结尾之外,还不能有多余的点。解决方案是将文件名从 更改为.!include!includedirmy.cnf.localmy-local.cnf