mysql master never resolves the same method

Source: Internet
Author: User

Method one: After ignoring the error, continue syncing
This method is applicable to the case that the data of master-slave database is not very different, or the data can not be completely unified, the data requirements are not strict.
Stop slave;
#表示跳过一步错误, the following numbers are variable
Set global sql_slave_skip_counter = 1;
Start slave;

View slave status
Mysql> Show slave status;

Method Two: From the new boss

The steps to resolve are as follows:
1. Advanced Master Library, lock table, prevent data write
Use the command:
Mysql> flush tables with read lock;

2. Perform data backup

Mysqldump-u root-p Regional_fe >/home/mysql/regional_fe.sql

3. View Master Status
Mysql> Show master status;

4. Unlock the main library table

Unlock tables;

5. Upload the backup data to the slave library

SCP Regional_fe.sql [Email protected]:/home/mysql/

6. Then go to the slave library to stop the master and subordinate to execute MySQL command, import data backup

mysql> stop Slave;
Mysql> Source/home/mysql/regional_fe.sql

7. Set synchronization from the library, note that the synchronization point is in the main library show Master status information | file| Position two items
Change Master to Master_host = ' 192.168.30.121 ', master_user = ' repl ', master_port=3306, master_password= ' 123456 ', master _log_file = ' mysqld-bin.000006 ', master_log_pos=120;
8. Re-open from sync
mysql> stop Slave;
9. View sync Status
Mysql> Show slave status\g View:
Slave_io_running:yes
Slave_sql_running:yes
OK, the sync is done.

mysql master never resolves the same method

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.