主库binlog没数据,说明在宕机的时候写binlog到磁盘的时候出问题了。主库的binlog丢失了。
如果直接拉起主库,从库获取不到主库binlog会报错。
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 position > file size; the first event 'mysql-bin.000268' at 371718450, the last event read from '/data/mysql_3307_xxxxx/binlog/mysql-bin.000268' at 4, the last byte read from '/data/mysql_3307_arena/binlog/mysql-bin.000268' at 4.'
Last_SQL_Errno: 0
stop slave;
change postion从主库的错误日志获取。
检测一下这个点位的那一条数据,容易主从不一致。
根据经验,从库数据一般会比主库数据多,建议直接切换到从库。