MySQL cannot master-slave replication solution. mysql master-slave

Source: Internet
Author: User

MySQL cannot master-slave replication solution. mysql master-slave

<Span style = "font-size: 18px;"> ******** the slave database cannot be synchronized ******** show slave status to show that slave_ SQL _runing is NO, seconds_behind_master is null. Cause: A: The program may perform write operations on slave. B: It may also be caused by transaction rollback after the slave machine is restarted. solution 1: slave stop; set GLOBAL SQL _SLAVE_SKIP_COUNTER = 1; set a GLOBAL parameter slave start; solution 2: (1): salve (slave) database, slave stop; -- stop the slave Service master (master) database, show master status; get & A log file name & B location -- get the current binary log and offset on the master server (2): salve Database: View status, if yes, perform manual synchronization on the salve server. Manually change master to master_host = "192.168.101.1", master_uset = "user1", master_password = "pass123456", master_port = 3306, master_log_file = "mysql-bin.00003", step (1) found & A log file name master_log_pos = 98; step (1) found & B location -- can be manually synchronized after (3) start salve start. (4) Check Salve_ SQL _Runing as yes by using show salve status. If Seconds_Behind_Master is 0, it is normal </span>


Mysql master-slave replication is not synchronized

Error message?
 
Mysql master-slave replication, problems encountered after linux restart

Mysql restarts on the host, but the binlog index is inconsistent only when your slave mysql is not restarted, before the slave mysql instance restarts, The slave_io_running thread always keeps communicating with the host and transmits binlog updates. After the host crashes, slave_io_running will wait until the status changes to NO, and the entire replication will stop. It should be said that the host is in sleep state. After the host recovers, it cannot be identified from the host, you can only stop the slave and start it again, or change the master operation. Actually, you can only restart the slave mysql.

Related Article

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.