標籤:cli day 檔案 t_sql can decode upd 標題 put
MySQL 報錯 Last_SQL_Errno: 1032
show slave status \G
Last_SQL_Errno: 1032Last_SQL_Error: Could not execute Update_rows event on table 35lq_db.dr_planstats_h; Can‘t find record in ‘dr_planstats_h‘, Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event‘s master log mysql-bin.000010, end_log_pos 317865
end_log_pos 有了它,根據pos值,在主庫上直接就能找到,找到那條資料,反做(變成insert)
/usr/local/mysql/bin/mysqlbinlog -v --base64-output=DECODE-ROWS /data/mysql/binlog/mysql-bin.000010 | grep -A ‘10‘ 317865
mysql> select * from 35lq_db.dr_planstats_h where id=39222;
知道是那條資料就好辦了,
我通過 Navicat for MySQL 把這個表匯出,
選擇SQL指令檔
勾選 ‘包含列的標題’
點擊‘開始’ 然後就可以看到匯出的sql檔案位置
使用notepad++ 開啟匯出的sql檔案
找到sql語句,在slave上插入,啟動slave。
使用notepad++ 開啟匯出的sql檔案
INSERT INTO `dr_planstats_h` (`id`, `day`, `hours`, `uid`, `planid`, `money`, `adstypeid`, `ipnums`, `views`, `clicks`) VALUES (39222, ‘2018-7-18‘, 11, 35, 65, 651.5340, 2, 0, 0, 0);
MySQL 報錯 Last_SQL_Errno: 1032