我在哪里可以find有关my.cnf指令的文档?

我正在浏览如何在mysql中设置基本的主/从复制。 http://crazytoon.com/2008/01/29/mysql-how-do-you-set-up-masterslave-replication-in-mysql-centos-rhel-fedora/

然而,当我做了一些谷歌search的一些指令,如“relay-log”或“服务器ID”下的[mysqld]选项,我找不到解释每个指令的页面。

有没有一个地方可以去注释所有可以在my.cnf中使用的指令,以及它们做什么?

如果你看看MySQL文档 ,你会注意到下面这行:

在运行MySQL程序时,可以在命令行中给出的任何长选项也可以在选项文件中给出。 要获取程序的可用选项列表,请使用–help选项运行。

进一步的细节澄清了上述说法:

用于在选项文件中指定选项的语法与命令行语法相似。但是,在选项文件中,省略选项名称中的前两个短划线,并且每行只指定一个选项。 例如,命令行上的–quick和–host = localhost应该在选项文件的不同行上指定为quick和host = localhost。 要在选项文件中指定–loose-opt_nameforms的选项,请将其写为loose-opt_name。

因此,在MAN页面中为相应的程序提供了选项列表(例如'mysql'部分或mysqld部分等,或者通过运行mysql --helpmysqld --verbose --help )(另请参阅MySQL Docs复制特定选项: 从属和主 )

例如,对于你的两个例子:

SERVER_ID

  The server ID. This value is set by the --server-id option. It is used for replication to enable master and slave servers to identify themselves uniquely. This variable was added in MySQL 3.23.26. 

中继日志= FILE_NAME

  The basename for the relay log. The default basename is host_name-relay-bin. The server writes the file in the data directory unless the basename is given with a leading absolute path name to specify a different directory. The server creates relay log files in sequence by adding a numeric suffix to the basename.