在從機(jī)器上做好了相應(yīng)的恢復(fù)后,我們要指定從機(jī)器所對應(yīng)的master信息,從而讓slave開始工作 手冊中解釋如下: CHANGE MASTER TO changes the parameters that the slave server uses for?connecting to and communicating with the master server. It also u
在從機(jī)器上做好了相應(yīng)的恢復(fù)后,我們要指定從機(jī)器所對應(yīng)的master信息,從而讓slave開始工作
手冊中解釋如下:
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.
這個命令連接master服務(wù)器,同時更新master.info和relay-log.info
*Note*: Replication cannot use Unix socket files. You must be able to?connect to the master MySQL server using TCP/IP.
這里說明復(fù)制不能使用socket來連接,必須是使用tcp/ip
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.
這兩個參數(shù)用來指定slave從那個坐標(biāo)開始讀取數(shù)據(jù),如果這兩個參數(shù)有設(shè)定的話就不能在指定RELAY_LOG_FILE或RELAY_LOG_POS
案例如下:
CHANGE MASTER TO
MASTER_HOST=’master2.liufofu.com’,
MASTER_USER=’replication’,
MASTER_PASSWORD=’liufofu’,
MASTER_PORT=3306,
MASTER_LOG_FILE=’master2-bin.001′,
MASTER_LOG_POS=4,
MASTER_CONNECT_RETRY=10;
本文出自:http://www.liufofu.com, 原文地址:http://www.liufofu.com/2014051110.html, 感謝原作者分享。
聲明:本網(wǎng)頁內(nèi)容旨在傳播知識,若有侵權(quán)等問題請及時與本網(wǎng)聯(lián)系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com