目前从库不同步,
查看状态:
mysql> show slave status\G
*************************** 1. row ***************************
Slave_IO_State:
Master_Host: xxxx
Master_User: xxx
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: xxx-bin.000001
Read_Master_Log_Pos: 1440046
Relay_Log_File: host-relay-bin.000001
Relay_Log_Pos: 4
Relay_Master_Log_File:xxx-bin.000001
Slave_IO_Running: No
Slave_SQL_Running: Yes
Replicate_Do_DB: xxx
Replicate_Ignore_DB: mysql
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: 1440046
Relay_Log_Space: 106
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: 'Could not find first log file name in binary log index file'
Last_SQL_Errno: 0
Last_SQL_Error:
1 row in set (0.00 sec)
从服务器大量错误日志:
101027 16:50:58 [Note] Slave I/O thread: connected to master 'xxx@xxxxxx:3306',replication started in log 'xxx-bin.000001' at position 1440046
101027 16:50:58 [ERROR] Error reading packet from server: Could not find first log file name in binary log index file ( server_errno=1236)
101027 16:50:58 [ERROR] Slave I/O: Got fatal error 1236 from master when reading data from binary log: 'Could not find first log file name in binary log index file', Error_code: 1236
101027 16:50:58 [Note] Slave I/O thread exiting, read up to log 'xxx-bin.000001', position 1440046
主状态:
mysql> show master status\G
*************************** 1. row ***************************
File: mysql-bin.000001
Position: 1440046
Binlog_Do_DB:
Binlog_Ignore_DB:
1 row in set (0.00 sec)
按照正常流程解决,应该是:
slave stop;
CHANGE MASTER TO MASTER_HOST='xxx',MASTER_USER='xx',MASTER_PASSWORD='xx',MASTER_PORT=3306,MASTER_LOG_FILE='xxx-bin.000001',MASTER_LOG_POS=1440046;
slave start;
问题依然存在,
后来经过以下步骤解决,不过有点困惑:
1、重启主库
2、给从库重新授权
3、执行以下命令
slave stop;
reset slave;
slave start;
--转自