mysql中change master to

WBOY
發布: 2016-06-07 16:41:53
原創
2413 人瀏覽過

在从机器上做好了相应的恢复后,我们要指定从机器所对应的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

在从机器上做好了相应的恢复后,我们要指定从机器所对应的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服务器,同时更新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.

这里说明复制不能使用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.

这两个参数用来指定slave从那个坐标开始读取数据,如果这两个参数有设定的话就不能在指定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;

相關標籤:
來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!