Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Fix mysql slave replication 1032 error

2025-03-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

There is a 1032 error in a slave library. What is that 1032 error? let's take a look at it.

[root@BLAVDP021 ~] # perror 1032MySQL error code 1032 (ER_KEY_NOT_FOUND): Can't find record in'%-.19s'

To put it simply, the corresponding record cannot be found from the library, and there is relevant output in show slave status\ G;. Let's take a look at:

Last_Errno: 1032Last_Error: Could not execute Update_rows event on table lenovoweixin.wx_app_order_code; Can't find record in 'wx_app_order_code', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log mysql-bin.000129, end_log_pos 4448749

As you can see from the above, executing the update statement copied from master in slave causes the SQL thread to report an error and stop the application because the slave cannot find the data. In other words, the error is caused by the data inconsistency on master and slave.

In this case, it is common to find the error, then modify the data on the slave, and then start slave to continue the application.

The wrong statement is not explicitly given in show slave status, so you need to analyze the binary log on the main library to see which statement it is.

Mysqlbinlog-- no-defaults-- base64-output=decode-rows-v-v / data/mysql/mysql_data/mysql-bin.000129 | grep-A 200 '4448749' > syk.txtvim syk.txtUPDATE `lenovoweixin`.`wx _ app_order_ code `where @ 1 "1607124 @ 2" 67516889 @ 3 "https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=gQFe8TwAAAAAAAAAAS5odHRwOi8vd2VpeGluLnFxLmNvbS9xLzAyRThoN2gzSU1hamUxczJmTzFwMVYAAgSClGlZAwSAOgkA' @ 4" 201707144100080009'@ 5=NULL @ 6 "0 @ 7" 2017-07-15 12:05:22 @ 8 "2017-07-15 12:05: 22 @ 9=NULLSET @ 1 "1607124 @ 2" 67516889 @ 3 "https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=gQFe8TwAAAAAAAAAAS5odHRwOi8vd2VpeGluLnFxLmNvbS9xLzAyRThoN2gzSU1hamUxczJmTzFwMVYAAgSClGlZAwSAOgkA' @ 4"201707144100080009'@ 5"LHCTjusway" hiinGjHg2Qog1Cisaccessible Pgw' @ 6 "7" 1 @ 7 "2017-07-15 12:05:22 12:05:22 @ 8" 2017-07-15 12:05:22 @ 9='fd9d079f-6323-473bmur8f4aracd37273e2ac5c'

Then query whether there is this record in the slave library, but not in the slave library, so we need to manually create this record on the slave library as follows:

Insert into wx_app_order_code (id,scene_id,code_url,orderid,flag,create_time,update_time) values (1607124 https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=gQFe8TwAAAAAAAAAAS5odHRwOi8vd2VpeGluLnFxLmNvbS9xLzAyRThoN2gzSU1hamUxczJmTzFwMVYAAgSClGlZAwSAOgkA','201707144100080009',0,'2017-07-15 67516889 'https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=gQFe8TwAAAAAAAAAAS5odHRwOi8vd2VpeGluLnFxLmNvbS9xLzAyRThoN2gzSU1hamUxczJmTzFwMVYAAgSClGlZAwSAOgkA','201707144100080009',0,'2017-07-15 12 purse 05purr 22')

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report