mysql 主从 error:1236
slave端
MariaDB [one]> show slave status\G 或 show master logs;
*************************** 1. row ***************************
Slave_IO_State:
Master_Host: 192.168.1.38
Master_User: rep
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: master-bin.000001
Read_Master_Log_Pos: 748
Relay_Log_File: salve-bin.000002
Relay_Log_Pos: 1036
Relay_Master_Log_File: master-bin.000001
Slave_IO_Running: No
Slave_SQL_Running: Yes
Exec_Master_Log_Pos: 748
Relay_Log_Space: 1327
Last_IO_Errno: 1236
Last_IO_Error: Got fatal error 1236 from master when reading data from binary log: 'Client requested master to start replication from impossible position; the first event 'master-bin.000001' at 748, the last event read from 'master-bin.000001' at 4, the last byte read from 'master-bin.000001' at 4.'
master端
MariaDB [one]> reset master;
Query OK, 0 rows affected (0.17 sec)
MariaDB [one]>show master logs;
+-------------------+-----------+
| Log_name| File_size |
+-------------------+-----------+
| master-bin.000001 |313 |
+-------------------+-----------+
1 row in set (0.00 sec)
slave端
MariaDB [one]>stop slave;
Query OK, 0 rows affected (0.00 sec)
MariaDB [one]> change master to master_log_pos=313;
Query OK, 0 rows affected (0.02 sec)
MariaDB [one]> start slave;
Query OK, 0 rows affected (0.00 sec)
MariaDB [one]> show slave status\G
Last_SQL_Errno: 0
Last_SQL_Error: