Heim > Datenbank > MySQL-Tutorial > Hauptteil

mysql中change master to

WBOY
Freigeben: 2016-06-07 16:41:53
Original
2410 Leute haben es durchsucht

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

Verwandte Etiketten:
Quelle:php.cn
Erklärung dieser Website
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage
Über uns Haftungsausschluss Sitemap
Chinesische PHP-Website:Online-PHP-Schulung für das Gemeinwohl,Helfen Sie PHP-Lernenden, sich schnell weiterzuentwickeln!