Maison > base de données > tutoriel mysql > le corps du texte

mysql中change master to

WBOY
Libérer: 2016-06-07 16:41:53
original
2410 Les gens l'ont consulté

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

Étiquettes associées:
source:php.cn
Déclaration de ce site Web
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn
Tutoriels populaires
Plus>
Derniers téléchargements
Plus>
effets Web
Code source du site Web
Matériel du site Web
Modèle frontal
À propos de nous Clause de non-responsabilité Sitemap
Site Web PHP chinois:Formation PHP en ligne sur le bien-être public,Aidez les apprenants PHP à grandir rapidement!