问题描述:MYSQL数据库主从,出库报错Last_IO_Error: error reconnecting to master 'cpc@10.10.8.70:330
' - retry-time: 10 retries: 86400
************************************************************************
查看从库状态:
mysql> show slave status\G;
*************************** 1. row ***************************Slave_IO_State: Reconnecting after a failed master event read
Master_Host: 10.10.8.70
Master_User: cpc
Master_Port: 3306
Connect_Retry: 10
Master_Log_File: mysql.000001
Read_Master_Log_Pos: 2831
Relay_Log_File: mcnctsSrv-relay-bin.000002
Relay_Log_Pos: 2972
Relay_Master_Log_File: mysql.000001
Slave_IO_Running: No
Slave_SQL_Running: Yes
Replicate_Do_DB: cpc
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: 2831
Relay_Log_Space: 3131
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: 2003
Last_IO_Error: error reconnecting to master 'cpc@10.10.8.70:330
' - retry-time: 10 retries: 86400
Last_SQL_Errno: 0
Last_SQL_Error:
1 row in set (0.00 sec)
****************************************************************************
没有连上主库
***************************************************************************
分析过程:
1、主从库服务器网络是否能连通;可采用ping(在防火墙非禁ping的情况下);
C:\Documents and Settings\Administrator>ping 10.10.8.70 -
Pinging 10.10.8.70 with 32 bytes of data:
Reply from 10.10.8.70: bytes=32 time<1ms TTL=128
Reply from 10.10.8.70: bytes=32 time<1ms TTL=128
Reply from 10.10.8.70: bytes=32 time<1ms TTL=128
Reply from 10.10.8.70: bytes=32 time<1ms TTL=128
Reply from 10.10.8.70: bytes=32 time<1ms TTL=128
Reply from 10.10.8.70: bytes=32 time<1ms TTL=128
2、试着在从库机器上使用该账户是否能够连接至主库:
C:\Documents and Settings\Administrator>mysql -ucpc -h10.10.8.70 -pasdfsw
ERROR 2003 (HY000): Can't connect to MySQL server on '10.10.8.70' (10061)
连接不上,通过确认账号和密码都没问题。查看主库,发现主库mysql服务意外停止了。
可以确定问题主库mysql服务问题。处理启动主库MySQL服务。
问题解决。
再通过
show slave status\G;查看出库状态确认是否主从正常。