Syntax:
CHANGE MASTER TO master_def [, master_def] ...

master_def:
    MASTER_BIND = 'interface_name'
  | MASTER_HOST = 'host_name'
  | MASTER_USER = 'user_name'
  | MASTER_PASSWORD = 'password'
  | MASTER_PORT = port_num
  | MASTER_CONNECT_RETRY = interval
  | MASTER_HEARTBEAT_PERIOD = interval
  | MASTER_LOG_FILE = 'master_log_name'
  | MASTER_LOG_POS = master_log_pos
  | RELAY_LOG_FILE = 'relay_log_name'
  | RELAY_LOG_POS = relay_log_pos
  | MASTER_SSL = {0|1}
  | MASTER_SSL_CA = 'ca_file_name'
  | MASTER_SSL_CAPATH = 'ca_directory_name'
  | MASTER_SSL_CERT = 'cert_file_name'
  | MASTER_SSL_KEY = 'key_file_name'
  | MASTER_SSL_CIPHER = 'cipher_list'
  | MASTER_SSL_VERIFY_SERVER_CERT = {0|1}

CHANGE MASTER TO changes the parameters that the slave server uses for
connecting to and communicating with the master server. It also updates
the contents of the master.info and relay-log.info files.

If you do not specify a given parameter, it keeps its old value, except
as indicated in the following discussion. For example, if the password
to connect to your MySQL master has changed, you just need to issue
these statements to tell the slave about the new password:

STOP SLAVE; -- if replication was running
CHANGE MASTER TO MASTER_PASSWORD='new3cret';
START SLAVE; -- if you want to restart replication

There is no need to specify the parameters that do not change.

MASTER_HOST, MASTER_USER, MASTER_PASSWORD, and MASTER_PORT provide
information to the slave about how to connect to its master:

o MASTER_HOST and MASTER_PORT are the host name (or IP address) of the
  master host and its TCP/IP port.

  *Note*: Replication cannot use Unix socket files. You must be able to
  connect to the master MySQL server using TCP/IP.

  If you specify MASTER_HOST or MASTER_PORT, the slave assumes that the
  master server is different from before (even if you specify a host or
  port value that is the same as the current value.) In this case, the
  old values for the master binary log name and position are considered
  no longer applicable, so if you do not specify MASTER_LOG_FILE and
  MASTER_LOG_POS in the statement, MASTER_LOG_FILE='' and
  MASTER_LOG_POS=4 are silently appended to it.

  Setting MASTER_HOST='' (that is, setting its value explicitly to an
  empty string) is not the same as not setting MASTER_HOST at all.
  Setting this option to an empty string causes START SLAVE
  subsequently to fail. This issue is addressed in MySQL 5.5.
  (Bug#28796 (http://bugs.mysql.com/bug.php?id=28796))

o MASTER_USER and MASTER_PASSWORD are the user name and password of the
  account to use for connecting to the master.

MASTER_SSL, MASTER_SSL_CA, MASTER_SSL_CAPATH, MASTER_SSL_CERT,
MASTER_SSL_KEY, MASTER_SSL_CIPHER, and MASTER_SSL_VERIFY_SERVER_CERT
provide information about using SSL for the connection. See
http://dev.mysql.com/doc/refman/5.1/en/ssl-options.html, and
http://dev.mysql.com/doc/refman/5.1/en/replication-solutions-ssl.html.
MASTER_SSL_VERIFY_SERVER_CERT was added in MySQL 5.1.18. These options
can be changed even on slaves that are compiled without SSL support.
They are saved to the master.info file, but are ignored if the slave
does not have SSL support enabled.

MASTER_CONNECT_RETRY specifies how many seconds to wait between connect
retries. The default is 60. The number of reconnection attempts is
limited by the --master-retry-count server option; for more
information, see
http://dev.mysql.com/doc/refman/5.1/en/replication-options.html.

The next two options (MASTER_BIND and MASTER_HEARTBEAT_PERIOD) are
available in MySQL Cluster NDB 6.3 and later, but are not supported in
mainline MySQL 5.1:

o MASTER_BIND is for use on replication slaves having multiple network
  interfaces, and determines which of the slave's network interfaces is
  chosen for connecting to the master. It is also possible to determine
  which network interface is to be used in such cases by starting the
  slave mysqld process with the --master-bind option.

  The ability to bind a replication slave to specific network interface
  was added in MySQL Cluster NDB 6.3.4.

o MASTER_HEARTBEAT_PERIOD is used to set the interval in seconds
  between replication heartbeats. Whenever the master's binlog is
  updated with an event, the waiting period for the next heartbeat is
  reset. interval is a decimal value having the range 0 to 4294967
  seconds and a resolution to hundredths of a second; the smallest
  nonzero value is 0.001. Heartbeats are sent by the master only if
  there are no unsent events in the binlog file for a period longer
  than interval.

  Setting interval to 0 disables heartbeats altogether. The default
  value for interval is equal to the value of slave_net_timeout divided
  by 2.

  Setting @@global.slave_net_timeout to a value less than that of the
  current heartbeat interval results in a warning being issued. The
  effect of issuing RESET SLAVE on the heartbeat interval is to reset
  it to the default value.

  MASTER_HEARTBEAT_PERIOD was added in MySQL Cluster NDB 6.3.4.

MASTER_LOG_FILE and MASTER_LOG_POS are the coordinates at which the
slave I/O thread should begin reading from the master the next time the
thread starts. If you specify either of them, you cannot specify
RELAY_LOG_FILE or RELAY_LOG_POS. If neither of MASTER_LOG_FILE or
MASTER_LOG_POS are specified, the slave uses the last coordinates of
the slave SQL thread before CHANGE MASTER TO was issued. This ensures
that there is no discontinuity in replication, even if the slave SQL
thread was late compared to the slave I/O thread, when you merely want
to change, say, the password to use.

CHANGE MASTER TO deletes all relay log files and starts a new one,
unless you specify RELAY_LOG_FILE or RELAY_LOG_POS. In that case, relay
log files are kept; the relay_log_purge global variable is set silently
to 0.

CHANGE MASTER TO is useful for setting up a slave when you have the
snapshot of the master and have recorded the master binary log
coordinates corresponding to it. After loading the snapshot into the
slave, you can run CHANGE MASTER TO MASTER_LOG_FILE='log_name',
MASTER_LOG_POS=log_pos on the slave to specify the master binary log
coodinates.

The following example changes the master server the slave uses and
establishes the master binary log coordinates from which the slave
begins reading. This is used when you want to set up the slave to
replicate the master:

CHANGE MASTER TO
  MASTER_HOST='master2.mycompany.com',
  MASTER_USER='replication',
  MASTER_PASSWORD='bigs3cret',
  MASTER_PORT=3306,
  MASTER_LOG_FILE='master2-bin.001',
  MASTER_LOG_POS=4,
  MASTER_CONNECT_RETRY=10;

The next example shows an operation that is less frequently employed.
It is used when the slave has relay log files that you want it to
execute again for some reason. To do this, the master need not be
reachable. You need only use CHANGE MASTER TO and start the SQL thread
(START SLAVE SQL_THREAD):

CHANGE MASTER TO
  RELAY_LOG_FILE='slave-relay-bin.006',
  RELAY_LOG_POS=4025;

URL: http://dev.mysql.com/doc/refman/5.1/en/change-master-to.html

