MySQL斷電,出現 Error 1236
今天幾臺MySQL伺服器突然停電,重啟後複製無法啟動,總是報如下錯誤:
080922 10:29:01 [Note] Slave SQL thread initialized, starting replication in log 'mysql-bin.000778' at position 2874108, relay log '
./relay-bin.003287' position: 2874245
080922 10:29:01 [Note] Slave I/O thread: connected to master 'replication@192.168.0.10:3306', replication started in log 'mysql-b
in.000778' at position 2874108
080922 10:29:01 [ERROR] Error reading packet from server: Client requested master to start replication from impossible position ( se
rver_errno=1236)
080922 10:29:01 [ERROR] Got fatal error 1236: 'Client requested master to start replication from impossible position' from master wh
en reading data from binary log
為什麼會報impossible position呢?開啟mysql-bin.000778看看。
mysqlbinlog mysql-bin.000778 > log.sql
tail -f log.sql
# at 2871574
#080922 10:20:27 server id 2 end_log_pos 2871601 Xid = 2516638
COMMIT/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/
最後一個position是2871574,而從庫要從2874108開始,難怪報impossible position,難道是斷電時有部分log在快取中還沒來得及寫入binglog?無論如何先恢復再說吧
stop slave;
CHANGE MASTER TO
MASTER_LOG_FILE='mysql-bin.000778',
MASTER_LOG_POS=2871574;
start slave;
show slave statusG
同步正常。。
後來檢視主庫的啟動日誌中這樣一段
InnoDB: Last MySQL binlog file position 0 2874108, file name ./mysql-bin.000778
080922 10:22:09 InnoDB: Started; log sequence number 6 2534366248
080922 10:22:09 [Note] Recovering after a crash using mysql-bin
080922 10:22:09 [Note] Starting crash recovery...
080922 10:22:09 [Note] Crash recovery finished.
080922 10:22:09 [Note] /usr/sbin/mysqld: ready for connections.
這裡Last MySQL binlog file position 0 2874108也是錯誤的,這個資訊到底是哪裡來的呢?為什麼會這樣呢?不明白。
為了保證以後binglog及時寫入,將主庫sync_binlog變數設定1。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/124805/viewspace-1010913/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 【MySql】MySQL Replication Fatal Error 1236MySqlError
- MySQL Replication Fatal Error 1236MySqlError
- Mysql主機斷電導致複製出錯 server_errno=1236MySqlServer
- MySQL主從同步報error 1236MySql主從同步Error
- 【MySQL】Got fatal error 1236原因和解決方法MySqlGoError
- Last_IO_Error: Got fatal error 1236ASTErrorGo
- 【Mysql】Slave_IO_Running: No---Got fatal error 1236 from masterMySqlGoErrorAST
- 【Mysql】Mysql GTID複製程式出現異常,出現斷點MySql斷點
- mysql主從同步失敗Last_IO_Error: Got fatal error 1236 from master解決方法MySql主從同步ASTErrorGo
- MySQL案例09:Last_IO_Error: Got fatal error 1236 from master when reading data from binary logMySqlASTErrorGo
- Mysql:1236常見錯誤MySql
- MySQL主從複製報錯:Got fatal error 1236 from master when reading data fromMySqlGoErrorAST
- MySQL複製環境Slave報錯"Got fatal error 1236 from master when reading data"MySqlGoErrorAST
- Percona MySQL 5.6 主主複製環境報錯"Got fatal error 1236 from master.."MySqlGoErrorAST
- 解決CentOS 6.5斷電後啟動出現:unexpectedCentOS
- MySQL 使用 show tables 時出現 ERROR 1449 (HY000) 問題MySqlError
- 安裝MySql出現Error Nr.1045的解決辦法MySqlError
- 主庫異常當機---從庫複製報fatal error 1236Error
- Ubuntu git pull 出現Permission denied ErrorUbuntuGitError
- Got fatal error 1236 from master when reading data from binary logGoErrorAST
- MySQL資料庫1236錯誤模擬和解決MySql資料庫
- android 打包出現錯誤Error: ResourceNameAndroidError
- 更改密碼時出現ERROR 1054密碼Error
- CocoaPods安裝出現SSL verification errorError
- sloaris 出現“mount: I/O error”錯誤Error
- 安裝MySQL出現Job for mysqld.service failed because the control process exited with error codeMySqlAIError
- MySQL斷電恢復的一點簡單分析MySql
- 公牛智慧插座二代釋出:支援斷網斷電記憶
- win10電腦開機出現a disk read error occurred錯誤修復方法Win10Error
- ArchLinux出現ACPI ERROR的解決方法LinuxError
- sublime 出現 [Decode error - output not utf-8]Error
- openGauss 出現-Error-No-space-left-on-device-提示Errordev
- 提交spark程式到yarn出現ERROR SparkContext: Error initializing SparkContext.SparkYarnErrorContext
- Linux安裝mysql出現ERROR! The server quit without updating PID file問題解決LinuxMySqlErrorServerUI
- 關於mysql登入出現報錯資訊:ERROR1045(28000)的解決方法MySqlError
- HDU 1236 排名(Java)Java
- linux CentOS出現Error: xz compression not availableLinuxCentOSErrorAI
- 突然斷電,是否會影響Mysql的執行結果MySql