Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm skimming through how to set up a basic master/slave replication in mysql.

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
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
up vote 6 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:


      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.


       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


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.