6.1 Special gift for children's Day, MySQL sync failed

Source: Internet
Author: User

Today is 61 children's Day, is a very memorable days, 9 in the morning to the company to work, the matter came, due to the development of negligence, to import a library into the library, and then when the development of the discovery of the wrong database server, and not to our operations personnel to reflect, when the main library is not data, and then developed in the main library As follows:

mysql> show slave status\g;*************************** 1. row ***************                slave_io _state: waiting for master to send event                   Master_Host: 192.168.0.155                   master_ user: myslave                   Master_Port: 3306                 Connect_Retry: 60               Master_Log_File: mysql-bin.000001           read_master_log_pos: 804                Relay_Log_File: relay-log-bin.000002                 Relay_Log_Pos: 253         relay_master_log_file: mysql-bin.000001              Slave_IO_Running: Yes             slave_sql_running: no               replicate_do_db:           replicate_ignore_db:             Replicate_Do_Table:         replicate_ignore_table:       replicate_wild_do_ Table:   replicate_wild_ignore_table:                     Last_Errno: 1008                    Last_Error: Error  ' Can ' T drop  database  ' data ';  DATABASE DOESN ' t exist '  on query. Default  database:  ' data ' . query:  ' Drop database data '                   Skip_Counter: 0           Exec_Master_Log_Pos: 562               Relay_Log_Space: 949               Until_Condition: None                until_log_file:                  Until_Log_Pos: 0            Master_SSL_Allowed: No            Master_ssl_ca_file:            master_ssl_ca_path:                master_ssl_cert:              Master_SSL_Cipher:                 Master_SSL_Key:          seconds_behind_master: nullmaster_ssl_verify_server_cert:  no                last_ Io_errno: 0                last_io_error:                 Last_SQL_Errno: 1008                last_sql_error: error   ' Can ' t drop database  ' data ';  DATABASE DOESN ' t exist '  on query.  Default database:  ' data ' . query:  ' Drop database data '   replicate _ignore_server_ids:              master_ server_id: 11 row in set  (0.00 sec) Tip: The error message is that the database cannot be revoked and the database does not exist. ', 1008 error binate created this library, and then the master was created again, causing a database synchronization conflict

Workaround:

Stop Slave;set global Sql_slave_skip_counter=1;start slave;

From library Status:

mysql> show slave status\g;*************************** 1. row ***************                slave_io _state: waiting for master to send event                   Master_Host: 192.168.0.155                   master_ user: myslave                   Master_Port: 3306                 Connect_Retry: 60               Master_Log_File: mysql-bin.000001           read_master_log_pos: 804                Relay_Log_File: relay-log-bin.000004                 Relay_Log_Pos: 253         relay_master_log_file: mysql-bin.000001              Slave_IO_Running: Yes             slave_sql_running: yes               replicate_do_db:           replicate_ignore_db:             Replicate_Do_Table:         replicate_ignore_table:       replicate_wild_ Do_table:   replicate_wild_ignore_table:                     Last_Errno: 0                    Last_Error:                   Skip_Counter: 0           Exec_Master_Log_Pos: 804               Relay_Log_Space: 553               Until_Condition: None                Until_Log_File:                  Until_Log_Pos: 0            master_ssl_allowed: no            master_ssl_ca_file:            master_ssl_ca _path:               master_ssl_ cert:             master_ssl_cipher:                 master_ssl_key:          seconds_behind_master: 0master_ssl_verify_server_ cert: no                 last_io_errno: 0                 Last_IO_Error:                 Last_SQL_Errno: 0               last_sql_error:    Replicate_Ignore_Server_Ids:               Master_Server_Id: 11 row in set  (0.00 SEC)

It's OK.

1) for ordinary internet business, ignoring the problem is not very big. Of course, to confirm that does not affect the company's business premise.

2) The Enterprise scenario solves the master-slave synchronization, which is more important than the primary, and then if the master-slave data is consistent, it is also important to recover this from the library at a time.

The master-slave data inconsistency is more important than maintaining the master-slave synchronous continuous state. So we want us to choose according to the business.


This article is from the "Little Rookie" blog, please be sure to keep this source http://baishuchao.blog.51cto.com/12918589/1931271

6.1 Special gift for children's Day, MySQL sync failed

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.