这是我遇到并解决的问题的文档。
\n\n我尝试使用 MySQL\xe2\x80\x99s!includedir
指令将文件包含在conf.d
目录中,但 \xe2\x80\x99s 不起作用。我尝试搞乱权限和一切。这是我的配置树:
/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
:
[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
未加载指定的文件。解决方法见下文......
事实证明,除了要求(and ).cnf
中的文件有结尾之外,还不能有多余的点。解决方案是将文件名从 更改为.!include
!includedir
my.cnf.local
my-local.cnf