Mysql 1864 主從錯誤解決方法

從字面意思看了一下是因?yàn)閟lave_pending_jobs_size_max默認(rèn)值為16777216(16MB),但是slave接收到的slave_pending_jobs_size_max為17085453(17M);
解決方案
從庫執(zhí)行如下SQL
mysql>stop slave; mysql>set global slave_pending_jobs_size_max=20000000; mysql> start slave;
#在多線程復(fù)制時,在隊(duì)列中Pending的事件所占用的最大內(nèi)存,默認(rèn)為16M,如果內(nèi)存富余,或者延遲較大時,可以適當(dāng)調(diào)大;注意
這個值要比主庫的max_allowed_packet大
故障模擬:
從庫設(shè)置
mysql> set global slave_parallel_workers=4; mysql> show variables like 'slave_parallel_workers'; +------------------------+-------+ | Variable_name | Value | +------------------------+-------+ |slave_parallel_workers | 4 | +------------------------+-------+ 1 row in set (0.00sec) mysql>set global slave_pending_jobs_size_max=1024; mysql> show variables like 'slave_pend%'; +-----------------------------+-------+ | Variable_name | Value | +-----------------------------+-------+ |slave_pending_jobs_size_max | 1024 | +-----------------------------+-------+ 1 row in set (0.00sec)
主庫操作:
mysql> update erp_mkpf set usnam='測試1864錯誤'; ERROR 1197 (HY000):Multi-statement transaction required more than 'max_binlog_cache_size' bytes ofstorage; increase this mysqld variable and try again mysql> set global max_binlog_cache_size=8388608000000; Query OK, 0 rowsaffected (0.00 sec) mysql> begin; Query OK, 0 rowsaffected (0.00 sec) mysql> update erp_mkpf set usnam='測試1864錯誤'; Query OK, 70466 rowsaffected (0.38 sec) Rows matched:70466 Changed: 70466 Warnings: 0 mysql> commit; Query OK, 0 rowsaffected (0.08 sec)
從庫查看狀態(tài):
mysql> show slavestatus\G Last_SQL_Errno: 1864 Last_SQL_Error: Cannot scheduleevent Update_rows, relay-log name ./HE1-relay-bin.000005, position 494 toWorker thread because its size 8200 exceeds 1024 ofslave_pending_jobs_size_max.
以上所述是小編給大家介紹的Mysql 1864 主從錯誤解決方法,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復(fù)大家的。在此也非常感謝大家對腳本之家網(wǎng)站的支持!
相關(guān)文章
Mysql刪除數(shù)據(jù)以及數(shù)據(jù)表的方法實(shí)例
這篇文章主要給大家介紹了關(guān)于Mysql刪除數(shù)據(jù)以及數(shù)據(jù)表的相關(guān)資料,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2020-11-11
MySQL錯誤代碼1862 your password has expired的解決方法
這篇文章主要為大家詳細(xì)介紹了MySQL錯誤代碼1862 your password has expired的解決方法,具有一定的參考價值,感興趣的小伙伴們可以參考一下2018-08-08
MySQL窗口函數(shù)實(shí)現(xiàn)榜單排名
相信大家在日常的開發(fā)中經(jīng)常會碰到榜單類的活動需求,本文主要介紹了MySQL窗口函數(shù)實(shí)現(xiàn)榜單排名,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2023-04-04
mysql啟動報錯MySQL server PID file could not be found
這篇文章主要介紹了mysql啟動報錯MySQL server PID file could not be found,具有一定的參考價值,感興趣的小伙伴們可以參考一下2016-11-11
Mysql誤刪數(shù)據(jù)解決方案及kill語句原理
這篇文章主要介紹了Mysql誤刪數(shù)據(jù)解決方案及kill語句原理,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友可以參考下2020-09-09
MySQL數(shù)據(jù)庫varchar的限制規(guī)則說明
本文我們主要介紹了MySQL數(shù)據(jù)庫中varchar的限制規(guī)則,并以一個實(shí)際的例子對限制規(guī)則進(jìn)行了說明,希望能夠?qū)δ兴鶐椭?/div> 2011-08-08最新評論

