国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 數(shù)據(jù)庫(kù) > MySQL > 正文

MySQL Error 1236 錯(cuò)誤解決辦法

2024-07-24 12:39:17
字體:
供稿:網(wǎng)友

在一次不小心電腦突然掉電了,開機(jī)開就出來了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 

今天幾臺(tái)MySQL服務(wù)器突然停電,重啟后復(fù)制無法啟動(dòng),總是報(bào)如下錯(cuò)誤:

  1. 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 
  2.  
  3. 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 
  4.  
  5. 080922 10:29:01 [ERROR] Error reading packet from server: Client requested master to start replication from impossible position ( se rver_errno=1236)  --Vevb.com 
  6.  
  7. 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 

為什么會(huì)報(bào)impossible position呢?打開mysql-bin.000778看看.

  1. mysqlbinlog mysql-bin.000778 > log.sql 
  2.  
  3. tail -f log.sql 
  4.  
  5. at 2871574 #080922 10:20:27 server id 2 end_log_pos 2871601 Xid = 2516638 
  6.  
  7. COMMIT/*!*/; 
  8.  
  9. DELIMITER ; 
  10.  
  11. End of log file 
  12.  
  13. ROLLBACK /* added by mysqlbinlog */; 
  14.  
  15. /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/ 

最后一個(gè)position是2871574,而從庫(kù)要從2874108開始,難怪報(bào)impossible position,難道是斷電時(shí)有部分log在緩存中還沒來得及寫入binglog?無論如何先恢復(fù)再說吧.

  1. stop slave; 
  2.  
  3. CHANGE MASTER TO 
  4.  
  5. MASTER_LOG_FILE='mysql-bin.000778'
  6.  
  7. MASTER_LOG_POS=2871574; 
  8.  
  9. start slave; 
  10.  
  11. show slave statusG 

同步正常,后來查看主庫(kù)的啟動(dòng)日志中這樣一段:

  1. InnoDB: Last MySQL binlog file position 0 2874108, file name ./mysql-bin.000778 
  2.  
  3. 080922 10:22:09 InnoDB: Started; log sequence number 6 2534366248 
  4.  
  5. 080922 10:22:09 [Note] Recovering after a crash using mysql-bin 
  6.  
  7. 080922 10:22:09 [Note] Starting crash recovery... 
  8.  
  9. 080922 10:22:09 [Note] Crash recovery finished. 
  10.  
  11. 080922 10:22:09 [Note] /usr/sbin/mysqld: ready for connections. 

這里L(fēng)ast MySQL binlog file position 0 2874108也是錯(cuò)誤的,這個(gè)信息到底是哪里來的呢?為什么會(huì)這樣呢?不明白,為了保證以后binglog及時(shí)寫入,將主庫(kù)sync_binlog變量設(shè)置1.

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 洪雅县| 勐海县| 柳州市| 繁峙县| 固阳县| 海伦市| 神农架林区| 香港| 镇坪县| 弥勒县| 保山市| 信丰县| 连南| 普洱| 乡宁县| 德州市| 兴和县| 抚顺县| 本溪市| 瓮安县| 江达县| 兴文县| 巢湖市| 剑川县| 通海县| 土默特右旗| 忻州市| 湖北省| 罗源县| 兰州市| 临湘市| 阜城县| 河源市| 江陵县| 邹城市| 余干县| 安顺市| 瓮安县| 兴仁县| 平远县| 菏泽市|