13
13
--slave=<user>[<passwd>]@<host>:[<port>][:<socket>]
14
14
[[--help | --version] | --quiet |
15
15
--verbose | --testdb=<test database> | --pedantic
16
--rpl_user=<uid:passwd>]
16
--rpl_user=<uid:passwd> | --master-log-file=<log_file> |
17
--master-log-pos=<pos> | --start-from-beginning]
36
37
engine differs from the master and slave. Similarly, :option:`--pedantic`
37
38
requires the InnoDB storage engine to the be the same on the master and slave.
40
The utility will setup replication to start from the current binary log file
41
and position of the master. However, you can instruct the utility to start from
42
the beginning of recorded events by using the :option:`--start-from-beginning`
43
option. You can also provide a binary log file from the master with the
44
:option:`--master-log-file` option which will start replication from the first
45
event in that binary log file. Or you can start replication from a specific
46
binary log file and position with the :option:`--master-log-file` and
47
:option:`--master-log-pos` options. In summary, replication can be started
48
using one of the following strategies.
50
Start from current position (default)
51
Start replication from last known binary log file and position from the
52
master. The *SHOW MASTER STATUS* command is used to retrieve this
55
Start from the beginning
56
Start replication from the first event recorded in the binary logging of the
59
Start from a binary log file
60
Start replication at the first event in a specific binary log file.
62
Start from a specific event
63
Start replication from a specific position (event) in a specific binary log
39
66
The :option:`-vv` option will also display any discrepancies among the storage
40
67
engines and InnoDB values with or without the :option:`--pedantic` option.
70
97
database name to use in testing replication setup (optional)
99
.. option:: --master-log-file=<MASTER_LOG_FILE>
101
use this master log file to initiate the slave.
103
.. option:: --master-log-pos=<MASTER_LOG_POS>
105
use this position in the master log file to initiate the slave
107
.. option:: --start-from-beginning, -b
109
start replication at the beginning of logged events. Not valid with
110
--master-log-file or --master-log-pos
72
112
.. option:: --verbose, -v
74
114
control how much information is displayed. For example, -v =
98
138
the default settings, use this command::
100
140
$ mysqlreplicate --master=root@localhost:3306 \\
101
--slave=root@localhost:3307 --rpl-user=rpl:rpl
141
--slave=root@localhost:3307 --rpl-user=rpl:rpl
102
142
# master on localhost: ... connected.
103
143
# slave on localhost: ... connected.
104
144
# Checking for binary logging on master...
128
168
# Unlocking tables on master...
171
The following command starts replication from the current position of the
174
$ mysqlreplicate --master=root@localhost:3306 \\
175
--slave=root@localhost:3307 --rpl-user=rpl:rpl
176
# master on localhost: ... connected.
177
# slave on localhost: ... connected.
178
# Checking for binary logging on master...
179
# Setting up replication...
182
The following command tarts replication from the beginning of recorded events.::
184
$ mysqlreplicate --master=root@localhost:3306 \\
185
--slave=root@localhost:3307 --rpl-user=rpl:rpl \\
186
--start-from-beginning
187
# master on localhost: ... connected.
188
# slave on localhost: ... connected.
189
# Checking for binary logging on master...
190
# Setting up replication...
193
The following starts replication from the beginning of a specific binary log
196
$ mysqlreplicate --master=root@localhost:3306 \\
197
--slave=root@localhost:3307 --rpl-user=rpl:rpl \\
198
--master-log-file=my_log.000003
199
# master on localhost: ... connected.
200
# slave on localhost: ... connected.
201
# Checking for binary logging on master...
202
# Setting up replication...
205
The following starts replication from an arbitrary binary log file and
208
$ mysqlreplicate --master=root@localhost:3306 \\
209
--slave=root@localhost:3307 --rpl-user=rpl:rpl \\
210
--master-log-file=my_log.000001 --master-log-pos=96
211
# master on localhost: ... connected.
212
# slave on localhost: ... connected.
213
# Checking for binary logging on master...
214
# Setting up replication...