Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm skimming through how to set up a basic master/slave replication in mysql. http://crazytoon.com/2008/01/29/mysql-how-do-you-set-up-masterslave-replication-in-mysql-centos-rhel-fedora/

However when I did a google search on some of the directives like 'relay-log' or 'server-id' under the [mysqld] option I could not find a page that explains each directive.

Is there a place I can go to that annotates all the directives that can be used in my.cnf and what they do?

share|improve this question
1  
Everything you need is well documented on the MySQL web site. Additionally, for each of the examples you cited Google turns up plenty of results, including pages straight into the MySQL docs. –  John Gardeniers Jan 8 '12 at 4:02

1 Answer 1

up vote 5 down vote accepted

If you look at the MySQL documentation, you will notice the following line:

Any long option that may be given on the command line when running a MySQL program can be given in an option file as well. To get the list of available options for a program, run it with the --help option.

Further details clarify the above statement:

The syntax for specifying options in an option file is similar to command-line syntax.. However, in an option file, you omit the leading two dashes from the option name and you specify only one option per line. For example, --quick and --host=localhost on the command line should be specified as quick and host=localhost on separate lines in an option file. To specify an option of the form --loose-opt_name in an option file, write it as loose-opt_name.

The list of options, therefore, is provided in the MAN page for the appropriate program (e.g. the 'mysql' section or the mysqld section, etc. or by running mysql --help or mysqld --verbose --help) (Also see the MySQL Docs for replication specific options: Slave and Master)

For instance, for your two examples:

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.

relay-log=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.
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.