MySQL涓讳粠澶辫触鎶ラ敊璇細 Got fatal error 1236

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了MySQL涓讳粠澶辫触鎶ラ敊璇細 Got fatal error 1236相关的知识,希望对你有一定的参考价值。

鏍囩锛?a href='http://www.mamicode.com/so/1/test' title='test'>test   浣嶇疆   packet   ast   second   dde   user   闂   oca   

涓€銆侀棶棰樺師鍥犲強鎶ラ敊璇俊鎭?/h2>

鐢变簬mysql涓诲簱鎰忓閲嶅惎锛屽鑷翠粠搴撴棤娉曞悓姝ユ姤閿欏涓嬶細

鐧诲綍浠庡簱鏌ョ湅涓讳粠鍚屾鐨勯敊璇俊鎭?/strong>

[[email protected]192-168-7-101 mysql]# vim mysqld-error.log 2018-12-11 12:57:35 1788 [ERROR] Error reading packet from server: Client requested master to start replication from position > file size; the first event 鈥?/span>master-bin.002295鈥?/span> at 1021866995, the last event read from 鈥?/span>./master-bin.002295鈥?/span> at 4, the last byte read from 鈥?/span>./master-bin.002295鈥?/span> at 4. (server_errno=1236) 2018-12-11 12:57:35 1788 [ERROR] Slave I/O: Got fatal error 1236 from master when reading data from binary log: 鈥?/span>Client requested master to start replication from position > file size; the first event 鈥?/span>master-bin.002295鈥?/span> at 1021866995, the last event read from 鈥?/span>./master-bin.002295鈥?/span> at 4, the last byte read from 鈥?/span>./master-bin.002295鈥?/span> at 4.鈥?/span>, Error_code: 1236
[[email protected]192-168-7-101 mysql]# mysql -u root -p
mysql> show slave status G
*************************** 1. row ***************************
               Slave_IO_State:
                  Master_Host: 192.168.3.230
                  Master_User: repl
                  Master_Port: 3306
                Connect_Retry: 60
              Master_Log_File: master-bin.002295
          Read_Master_Log_Pos: 1021866995
               Relay_Log_File: 192-168-3-236-relay-bin.000001
                Relay_Log_Pos: 4
        Relay_Master_Log_File: master-bin.002295
             Slave_IO_Running: No
            Slave_SQL_Running: Yes
              Replicate_Do_DB:
          Replicate_Ignore_DB:
           Replicate_Do_Table:
       Replicate_Ignore_Table:
      Replicate_Wild_Do_Table:
  Replicate_Wild_Ignore_Table:
                   Last_Errno: 0
                   Last_Error:
                 Skip_Counter: 0
          Exec_Master_Log_Pos: 1021866995
              Relay_Log_Space: 120
              Until_Condition: None
               Until_Log_File:
                Until_Log_Pos: 0
           Master_SSL_Allowed: No
           Master_SSL_CA_File:
           Master_SSL_CA_Path:
              Master_SSL_Cert:
            Master_SSL_Cipher:
               Master_SSL_Key:
        Seconds_Behind_Master: NULL
Master_SSL_Verify_Server_Cert: No
                Last_IO_Errno: 1236
                Last_IO_Error: Got fatal error 1236 from master when reading data from binary log: 鈥楥lient requested master to start replication from position > file size; the first event 鈥榤aster-bin.002295鈥?at 1021866995, the last event read from 鈥?/master-bin.002295鈥?at 4, the last byte read from 鈥?/master-bin.002295鈥?at 4.鈥?/span>
               Last_SQL_Errno: 0
               Last_SQL_Error:
  Replicate_Ignore_Server_Ids:
             Master_Server_Id: 1
                  Master_UUID: f7c24af7-a54a-11e6-88b4-525400169c04
             Master_Info_File: /Data/work/local/mysql/master.info
                    SQL_Delay: 0
          SQL_Remaining_Delay: NULL
      Slave_SQL_Running_State: Slave has read all relay log; waiting for the slave I/O thread to update it
           Master_Retry_Count: 86400
                  Master_Bind:
      Last_IO_Error_Timestamp: 181211 12:57:35
     Last_SQL_Error_Timestamp:
               Master_SSL_Crl:
           Master_SSL_Crlpath:
           Retrieved_Gtid_Set:
            Executed_Gtid_Set:
                Auto_Position: 0
1 row in set (0.00 sec)

浜屻€佽В鍐虫柟娉?/h2>
1. 鍏堢櫥褰曞埌MySQL涓诲簱锛屾悳绱㈠悗骞舵湭鎵惧埌position鐨勪綅缃?/strong>

[[email protected]192-168-7-100 mysql]# mysqlbinlog --no-defaults --start-position=1021866995 master-bin.002295 /*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @[email protected]@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; # at 4 #181210 22:41:27 server id 1 end_log_pos 120 CRC32 0x1fe77f51 Start: binlog v 4, server v 5.6.30-log created 181210 22:41:27 BINLOG 鈥?F3sOXA8BAAAAdAAAAHgAAAAAAAQANS42LjMwLWxvZwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAEzgNAAgAEgAEBAQEEgAAXAAEGggAAAAICAgCAAAACgoKGRkAAVF/ 5x8= 鈥?/span>/*!*/; DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET [email protected]_COMPLETION_TYPE*/; /*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
2. 瑙f瀽binlog鏃ュ織鏂囦欢锛屾壘鍒扮1021866995鏈€杩戠殑position鏈€杩戠殑浣嶇疆102186424
[[email protected]
192-168-7-100 mysql]# mysqlbinlog --no-defaults master-bin.002295 >/root/test.sql
[[email protected]192-168-7-100 mysql]# vim /root/test.sql # at
102186284 #181211 0:05:07 server id 1 end_log_pos 102186315 CRC32 0xd5613884 Xid = 1912388 COMMIT/*!*/; # at 102186315 #181211 0:05:07 server id 1 end_log_pos 102186392 CRC32 0x2b89095e Query thread_id=13545 exec_time=1 error_code=0 SET TIMESTAMP=1544457907/*!*/; BEGIN /*!*/; # at 102186392 # at 102186424 3.鐧诲綍浠庡簱锛岄噸鏂版寚瀹氫富浠庣殑鍚屾浣嶇疆
[[email protected]192-168-7-101 mysql]# mysql -u root -p mysql
> stop slave; Query OK, 0 rows affected, 1 warning (0.00 sec) mysql> change master to master_log_file=鈥?/span>master-bin.002295鈥?/span>,master_log_pos=102186424; Query OK, 0 rows affected (0.16 sec) mysql> start slave; Query OK, 0 rows affected (0.03 sec) mysql> show slave status G *************************** 1. row *************************** Slave_IO_State: Queueing master event to the relay log Master_Host: 192.168.3.230 Master_User: repl Master_Port: 3306 Connect_Retry: 60 Master_Log_File: master-bin.002295 Read_Master_Log_Pos: 155577520 Relay_Log_File: 192-168-7.100-relay-bin.000002 Relay_Log_Pos: 498191 Relay_Master_Log_File: master-bin.002295 Slave_IO_Running: Yes Slave_SQL_Running: Yes Replicate_Do_DB: Replicate_Ignore_DB: Replicate_Do_Table: Replicate_Ignore_Table: Replicate_Wild_Do_Table: Replicate_Wild_Ignore_Table: Last_Errno: 0 Last_Error: Skip_Counter: 0 Exec_Master_Log_Pos: 102684331 Relay_Log_Space: 53391561 Until_Condition: None Until_Log_File: Until_Log_Pos: 0 Master_SSL_Allowed: No Master_SSL_CA_File: Master_SSL_CA_Path: Master_SSL_Cert: Master_SSL_Cipher: Master_SSL_Key: Seconds_Behind_Master: 46929 Master_SSL_Verify_Server_Cert: No Last_IO_Errno: 0 Last_IO_Error: Last_SQL_Errno: 0 Last_SQL_Error: Replicate_Ignore_Server_Ids: Master_Server_Id: 1 Master_UUID: f7c24af7-a54a-11e6-88b4-525400169c04 Master_Info_File: /Data/work/local/mysql/master.info SQL_Delay: 0 SQL_Remaining_Delay: NULL Slave_SQL_Running_State: updating Master_Retry_Count: 86400 Master_Bind: Last_IO_Error_Timestamp: Last_SQL_Error_Timestamp: Master_SSL_Crl: Master_SSL_Crlpath: Retrieved_Gtid_Set: Executed_Gtid_Set: Auto_Position: 0 1 row in set (0.00 sec)

 





































































以上是关于MySQL涓讳粠澶辫触鎶ラ敊璇細 Got fatal error 1236的主要内容,如果未能解决你的问题,请参考以下文章

MySQL涓讳粠澶嶅埗

ESXi鍒涘缓datastore鎶ラ敊Fail to create VMFS datastore瑙e喅鏂规硶

鎶ラ敊璇?锛?ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'name' of undefin

mariadb涓讳粠

鍦╠ocker涓儴缃瞨edis涓讳粠閰嶇疆

姘稿埄缃戠珯娉ㄥ崟瀹℃牳澶辫触涓嶇粰鍑烘鎬庝箞鍔烇紵