您好,登錄后才能下訂單哦!
小編給大家分享一下MySQL中出現(xiàn)復制1594錯誤怎么辦,相信大部分人都還不怎么了解,因此分享這篇文章給大家參考一下,希望大家閱讀完這篇文章后大有收獲,下面讓我們一起去了解一下吧!
現(xiàn)象:
mysql> show slave status\G;
*************************** 1. row ***************************
-------------------------------------------------
Master_Log_File: mysql-bin.000191
Read_Master_Log_Pos: 334164088
Relay_Log_File: mysql-srelay.000533
Relay_Log_Pos: 902042386
Relay_Master_Log_File: mysql-bin.000190
Slave_IO_Running: Yes
Slave_SQL_Running: No
Replicate_Wild_Ignore_Table:
Last_Errno: 1594
Last_Error: Relay log read failure: Could not parse relay log event entry. The possible reasons are: the master's binary log is corrupted (you can check this by running 'mysqlbinlog' on the binary log), the slave's relay log is corrupted (you can check this by running 'mysqlbinlog' on the relay log), a network problem, or a bug in the master's or slave's MySQL code. If you want to check the master's binary log or slave's relay log, you will be able to know their names by issuing 'SHOW SLAVE STATUS' on this slave.
error_log如下:
160519 18:42:21 [ERROR] Error reading relay log event: Could not open log file
160519 18:42:21 [ERROR] Slave SQL: Relay log read failure: Could not parse relay log event entry. The possible reasons are: the master's binary log is corrupted (you can check this by running 'mysqlbinlog' on the binary log), the slave's
relay log is corrupted (you can check this by running 'mysqlbinlog' on the relay log), a network problem, or a bug in the master's or slave's MySQL code. If you want to check the master's binary log or slave's relay log, you will be abl
e to know their names by issuing 'SHOW SLAVE STATUS' on this slave. Error_code: 1594
160519 18:42:21 [ERROR] Slave (additional info): File '/data/mysql3307/logs/mysql-srelay.030613' not found (Errcode: 2) Error_code: 29
160519 18:42:21 [Warning] Slave: File '/data/mysql3307/logs/mysql-srelay.030613' not found (Errcode: 2) Error_code: 29
160519 18:42:21 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log 'mysql-bin.009095' position 1069989357
解析:
從日志我們看出可能是master或者slave的binlog損壞或者網(wǎng)絡問題
但是網(wǎng)絡測過是正常的
然后stop slave,發(fā)現(xiàn)主庫上的binlog繼續(xù)增加,且沒產(chǎn)生error_log
由此懷疑從庫中繼binlog損害
解決:
既然找出了原因,解決就相對容易了
1.從庫執(zhí)行reset slave,清除掉binlog日志
2.從出錯前的位置開始啟動復制
本例的復制位置為:
'mysql-bin.009095' position 1069989357
以上是“MySQL中出現(xiàn)復制1594錯誤怎么辦”這篇文章的所有內(nèi)容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內(nèi)容對大家有所幫助,如果還想學習更多知識,歡迎關注億速云行業(yè)資訊頻道!
免責聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權內(nèi)容。