我如何找出正在使用的 my.cnf?

How do I find out what my.cnf is being used?

与 MySQL 一起,可以使用 my.cnf 指定配置属性。 MySQL 可能会在多个地方查找此文件,如果找不到,可能会使用内置默认值。

你怎么知道 my.cnf 正在使用什么?

mysqld --help --verbose | grep -B 1 cnf

"Default options are read from the following files in the given order:" 行下方是 MySQL 正在寻找 my.cnf 文件的位置。