use*_*637 2 mysql mysql-replication
我正在浏览如何在 mysql 中设置基本的主/从复制。 http://crazytoon.com/2008/01/29/mysql-how-do-you-set-up-masterslave-replication-in-mysql-centos-rhel-fedora/
但是,当我在 [mysqld] 选项下对某些指令(如“relay-log”或“server-id”)进行谷歌搜索时,我找不到解释每个指令的页面。
有没有我可以去注释所有可以在 my.cnf 中使用的指令以及它们做什么的地方?
如果您查看MySQL 文档,您会注意到以下行:
运行 MySQL 程序时在命令行上给出的任何长选项也可以在选项文件中给出。要获取程序的可用选项列表,请使用 --help 选项运行它。
进一步的细节澄清了上述声明:
在选项文件中指定选项的语法类似于命令行语法。但是,在选项文件中,您可以省略选项名称中前导的两个破折号,并且每行仅指定一个选项。例如,命令行上的 --quick 和 --host=localhost 应在选项文件的不同行中指定为 quick 和 host=localhost。要在选项文件中指定--loose-opt_name 形式的选项,请将其写为loose-opt_name。
因此,选项列表在相应程序的 MAN 页面中提供(例如,'mysql' 部分或mysqld 部分等,或通过运行mysql --help
或mysqld --verbose --help
)(另请参阅 MySQL 文档以了解复制特定选项:Slave和Master )
例如,对于您的两个示例:
服务器 ID
Run Code Online (Sandbox Code Playgroud)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.
中继日志=文件名
Run Code Online (Sandbox Code Playgroud)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.
归档时间: |
|
查看次数: |
6547 次 |
最近记录: |