Oracle 5.0 Reference Manual page 1455

Table of Contents

Advertisement

If you are setting up multiple slaves, each one must have a unique
differs from that of the master and from each of the other slaves. Think of
values as something similar to IP addresses: These IDs uniquely identify each server instance in the
community of replication partners.
You do not have to enable binary logging on the slave for replication to be enabled. However, if you
enable binary logging on the slave, you can use the binary log for data backups and crash recovery on
the slave, and also use the slave as part of a more complex replication topology (for example, where
the slave acts as a master to other slaves).
16.1.1.3. Creating a User for Replication
Each slave must connect to the master using a MySQL user name and password, so there must be
a user account on the master that the slave can use to connect. Any account can be used for this
operation, providing it has been granted the
create a different account for each slave, or connect to the master using the same account for each
slave.
You need not create an account specifically for replication. However, you should be aware that the
user name and password will be stored in plain text within the
"Slave Status
the replication process, to minimize the possibility of compromise to other accounts.
To create a new acccount, use
replication, use the
that account needs only the
repl, that can connect for replication from any host within the
statements on the master:
mysql>
CREATE USER 'repl'@'%.mydomain.com' IDENTIFIED BY 'slavepass';
mysql>
GRANT REPLICATION SLAVE ON *.* TO 'repl'@'%.mydomain.com';
See
Section 13.7.1, "Account Management
manipulation of user accounts.
16.1.1.4. Obtaining the Replication Master Binary Log Coordinates
To configure replication on the slave you must determine the master's current coordinates within its
binary log. You will need this information so that when the slave starts the replication process, it is able
to start processing events from the binary log at the correct point.
If you have existing data on your master that you want to synchronize on your slaves before starting
the replication process, you must stop processing statements on the master, and then obtain its
current binary log coordinates and dump its data, before permitting the master to continue executing
statements. If you do not stop the execution of statements, the data dump and the master status
information that you use will not match and you will end up with inconsistent or corrupted databases on
the slaves.
To obtain the master binary log coordinates, follow these steps:
1. Start a session on the master by connecting to it with the command-line client, and flush all tables
and block write statements by executing the
mysql>
FLUSH TABLES WITH READ LOCK;
For
InnoDB
How to Set Up Replication
Note
If you omit
server-id
slave refuses to connect to a master.
Logs"). Therefore, you may want to create a separate account that has privileges only for
CREATE
statement. If you create an account solely for the purposes of replication,
GRANT
REPLICATION SLAVE
tables, note that
FLUSH TABLES WITH READ LOCK
[1442]
(or set it explicitly to its default value of 0), a
REPLICATION SLAVE
master.info
USER. To grant this account the privileges required for
[577]
privilege. For example, to set up a new user,
mydomain.com
Statements", for more information on statements for
FLUSH TABLES WITH READ LOCK
1435
[1442]
value that
server-id
[1442]
server-id
[577]
privilege. You may wish to
file (see
Section 16.2.2.2,
domain, issue these
statement:
also blocks
COMMIT
operations.

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents