MySQL master-Slave library synchronization

Source: Internet
Author: User

#主库修改my. INI[mysqld]Server-Id=2Log-Bin=Mysql-Binbinlog-Do-Db=demo# modifying My.ini from a library[mysqld]Server-Id=3Replicate-Do-Db=Demo--Restart master and slave libraries after configuration is complete#主库为从库添加用户Grant ReplicationSlave,reload,super on *.*   toSlave@14.23.88. theIdentified by '123456', show master status, query host file/Postin+------------------+----------+--------------+------------------+-------------------+| File             |Position|binlog_do_db|binlog_ignore_db|Executed_gtid_set|+------------------+----------+--------------+------------------+-------------------+|Mysql-Bin.000004 |      722 |Demo|                  |                   |+------------------+----------+--------------+------------------+-------------------+1Rowinch Set(0.01sec) #从库 detect whether the main library can be connected to ensure that the master-slave communication Stop Slave; Turn off slave sync connection change master toMaster_host='14.23.88.111', Master_port=4569, Master_user='slave', Master_password='123456', Master_log_file='mysql-bin.000004', Master_log_pos=722; start slave;--Initiate a slave-to- machine step connectionShow slave status--View StatusWaiting forMaster toSend Event14.23.88.110Slave4569     -Mysql-Bin.000004    154DELL-Pc-Relay-Bin.000004    367Mysql-Bin.000004Yes Yes Demo0        0    154    623None0No0No0        0            2Ebd6ae04-6e14-11e8-b39c-444553544f53 C:\ProgramData\MySQL\MySQL Server5.7\data\master.info0Slave hasRead  AllRelayLog; Waiting forMore Updates86400                                0            

MySQL master-Slave library synchronization

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.