大网数据广告活动
服务器运维问答

MySQL 8 on Ubuntu: what's the difference between /etc/mysql/conf.d/ and /etc/mysql/mysql.conf.d/?

· 52CE 我爱测

As per title. In /etc/mysql/my.cnf I see: !includedir /etc/mysql/conf.d/ !includedir /etc/mysql/mysql.conf.d/ .cnf files from both location are loaded: why having two? Which one is the "right one" for my own .cnf?

问题原文

原帖链接 · Dr. Gianluigi Zane Zanettini · CC BY-SA 4.0

As per title. In /etc/mysql/my.cnf I see:

!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/

.cnf files from both location are loaded: why having two? Which one is the "right one" for my own .cnf?

社区高分解答

原帖链接 · Nicolas Göddel · CC BY-SA 4.0

In my case I had to add all my changes to the directory /etc/mysql/mysql.conf.d/ because it gets loaded last. So I added a file zz_myconfig.cnf to that directory with all my changes. The other way around the configuraion from /etc/mysql/mysql.conf.d/mysqld.cnf would overwrite my settings again which is unfortunate.

If the directory /etc/mysql/conf.d is the official way to go then it should also be the last include directory within /etc/mysql/my.cnf.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2019-02-16)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。