日期:2014-05-16  浏览次数:21019 次

mysql同步error(Slave_IO_Running: Connecting)
我的mysql版本:
[root@cancer ~]# rpm -qa|grep My
MySQL-shared-5.5.11-1.linux2.6
MySQL-devel-5.5.11-1.linux2.6
MySQL-embedded-5.5.11-1.linux2.6
MySQL-test-5.5.11-1.linux2.6
MySQL-server-5.5.11-1.linux2.6
MySQL-client-5.5.11-1.linux2.6
MySQL-shared-compat-5.5.11-1.linux2.6
[root@cancer ~]#
同步设置:主服务器:172.16.20.1 从服务器:172.16.20.2
1.主服务器上创建同步账户,修改my.cnf;重启,锁表,mysqldump导出数据库destoon;
2.从服务器上导入数据源destoon,修改my.cnf,重启mysql,登录change master...加入主服务器信息,slave start之后,show slave status\G;显示信息如下:
mysql> show slave status\G;
*************************** 1. row ***************************
  Slave_IO_State: Connecting to master
  Master_Host: 172.16.20.1
  Master_User: repliword
  Master_Port: 3306
  Connect_Retry: 60
  Master_Log_File:
  Read_Master_Log_Pos: 4
  Relay_Log_File: mysql-relay-bin.000002
  Relay_Log_Pos: 4
  Relay_Master_Log_File:
  Slave_IO_Running: Connecting
  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: 0
  Relay_Log_Space: 107
  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 connecting to master 'repliword@172.16.20.1 :3306' - retry-time: 60 retries: 86400
  Last_SQL_Errno: 0
  Last_SQL_Error:
  Replicate_Ignore_Server_Ids:
  Master_Server_Id: 0
1 row in set (0.00 sec)
重新reset slave,在加入master信息还是不行;
这时主服务执行
mysql> show processlist;
+----+------+-----------+------+---------+------+-------+------------------+
| Id | User | Host | db | Command | Time | State | Info |
+----+------+-----------+------+---------+------+-------+------------------+
| 37 | root | localhost | NULL | Query | 0 | NULL | show processlist |
+----+------+-----------+------+---------+------+-------+------------------+
1 row in set (0.00 sec)
从服务器显示:
mysql> show processlist;
+----+-------------+-----------+-------+---------+------+-----------------------------------------+------------------+
| Id | User | Host | db | Command | Time | State | Info |
+----+-------------+-----------+-------+---------+------+-----------------------------------------+------------------+
| 19 | root | localhost | smmdb | Query | 0 | NULL | show processlist |
| 22 | system user | | NULL | Connect | 513 | Connecting to master | NULL |
| 23 | sy