MySQL master-Slave Sync Interrupt FAQ

Source: Internet
Author: User

error_code:1032
Phenomenon
Last_error:could not execute Update_rows event on table kebao.t1; Can ' t find record in ' T1 ', error_code:1032; Handler error ha_err_key_not_found; The event ' s master Log mysql-bin.000014, End_log_pos 114166

140719 23:01:04 [ERROR] Slave sql:could not execute Delete_rows event on table zhumh.t; Can ' t find record in ' t ', error_code:1032; Handler error ha_err_end_of_file; The event ' s master Log mysql-bin.000004, End_log_pos 2359, error_code:1032

Reason
SQL thread interrupts from inconsistent library data in the main library as row or mixed mode
Solution
1. Go to the main library to see what updates are being performed on the event, and isolate the data
2. To see if this data exists, fix it from the library.
"How to avoid"
1. sql that could lead to an inconsistent primary
2. Do not use--BINLOG-IGNORE-DB and--replicate-ignore-db
3. Not suitable for trigger

Error_code: 1062

Phenomenon

Last_error:query caused different errors on master and slave. Error on master: ' Deadlock found if trying to get lock; Try restarting transaction ' (1213), Error on slave: ' Duplicate entry ' 176484282 ' for key 1 ' (1062). Default database: ' XXXXX '. Query: ' INSERT into T1 (id,cust_id,in_ucid,confrim_time)
SELECT Csl.id,csl.cust_id,csl.in_ucid,csl.add_time
From Tl_cust_stat_log CSL, Cust Cust
WHERE csl.add_time > Name_const (' stat_start_date ', _utf8 0x323031342d30342d31392031373a33303a3030) and Csl.add_ Time <= name_const (' stat_end_date ', _utf8 0x323031342d30342d32312031373a33303a3030)
and (csl.cur_stat_2 = ' 0609 ' and csl.opt_code = ' CBSA ') and csl.cust_id = cust.id and Cust.posid = Name_const (' Posidvar ', 34094) '
Reason
The main library executes this Insert MyISAM table with the Select from InnoDB table to the from table plus s lock, and another UPDATE statement deadlock, which causes this insert: Select is rolled back.
However, the MyISAM table of the insert was not rolled back, so it was credited to Binlog, which causes duplicate to be executed from the library key1062
"Solution"
1. Make sure that the UPDATE statement is consistent with the From library
Stop slave;
Set global sql_slave_skip_counter=1;
Start slave;
2. If not, remove the data from the library and re-execute the event.

MY.CNF settings, has been modified after
Slave-skip-errors = 1062 (for repairing master and slave)

error_code:1053

Phenomenon
140524 9:48:36 [ERROR] slave:error ' Server shutdown in progress ' on query. Default database: ' Crm_sale '. Query: ' Load data INFILE '/home/mysql/mysql/tmp/sql_load-3367957599-1103609990-72.data ' IGNORE into table XXX character Set UTF8 ', error_code:1053

Reason
Before mysql-5535,mysql-5615, there was this bug, an explicit kill query would cause 1053:server shutdown progress Error and interrupt the SQL thread.

"Solution"
Direct start slave;

Error_code: 1236

Phenomenon
error:1236 sqlstate:hy000 (Er_master_fatal_error_reading_binlog)
Message:got fatal error%d from master if reading data from binary log: '%s '
Reason
The Binlog has not been executed from the library, the main library has exceeded expire_log_days automatically deleted Binlog
Processing
1. If you miss the write, find the Binlog backup and perform the increment
2. If no write, re-change master to the first point of the first binlog on the main library

error_code:1298

Phenomenon

2014-12-31 07:25:01 32135 [Warning] Slave:unknown or incorrect time zone: ' UTC ' error_code:1298
2014-12-31 07:30:31 32219 [ERROR] Slave sql:error ' Unknown or incorrect time zone: ' UTC ' on query. Default database: ' Configuration '. Query: ' BEGIN ', error_code:1298

Processing
Mysql_tzinfo_to_sql/usr/share/zoneinfo | Mysql-uroot-proot1-s/mysqldata/socket/mysql.sock_dsp3609 MySQL

--timezone is the parameter of Mysqld_safe

[Mysqld_safe]
TimeZone = GMT

Verify:

SELECT @ @global. time_zone, @ @session. Time_zone;

MySQL master-Slave Sync Interrupt FAQ

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.