mysql同步error(Slave_IO_Running: Connecting)

花如月 2011-09-05 01:58:20
我的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 | system user | | NULL | Connect | 513 | Slave has read all relay log; waiting for the slave I/O thread to update it | NULL |
+----+-------------+-----------+-------+---------+------+-----------------------------------------------------------------------------+------------------+

从服务器log:
110905 1:06:32 [Note] Slave I/O thread exiting, read up to log 'mysql-bin.003910', position 9407
110905 1:06:36 [Note] 'CHANGE MASTER TO executed'. Previous state master_host='172.16.20.1', master_port='3306', master_log_file='mysql-bin.003910', master_log_pos='9407'. New state master_host='172.16.20.1', master_port='3306', master_log_file='mysql-bin.003910', master_log_pos='9407'.
110905 1:06:40 [Note] Slave SQL thread initialized, starting replication in log 'mysql-bin.003910' at position 9407, relay log './mysql-relay-bin.000001' position: 4
110905 1:06:43 [ERROR] Slave I/O: error connecting to master 'repliword@172.16.20.1:3306' - retry-time: 60 retries: 86400, Error_code: 2003
110905 1:38:09 [Warning] IP address '219.148.38.10' could not be resolved: no reverse address mapping.

哎呀,我实在不知道怎么做了,已经搞了一周了各位大侠帮我看看,分送上
110905 1:46:20 [Note] Error reading relay log event: slave SQL thread was killed
110905 1:46:20 [Note] Slave I/O thread killed while connecting to master
110905 1:46:20 [Note] Slave I/O thread exiting, read up to log 'mysql-bin.003910', position 9407
...全文
1786 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
群鹰李盼 2012-08-18
  • 打赏
  • 举报
回复
我是技术菜鸟 十分抱歉
chenfeilife 2012-07-30
  • 打赏
  • 举报
回复
上面的不会的话别乱发帖,这样会导致这位童鞋的时间大大的浪费!
lqx302 2012-02-22
  • 打赏
  • 举报
回复
先授权,主库与从库还没连接上呢。主库先允许从库与其同步。然后,从库再chang注意日志点。
九月茅桃 2011-09-07
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 salley_2010 的回复:]
我在检查检查,服务器不能随便重启,今晚上才能试下
[/Quote]

账号失效,2种情况,1是没有权限,2是账号的密码不对或者账号的ip地址有误。
花如月 2011-09-07
  • 打赏
  • 举报
回复
我在检查检查,服务器不能随便重启,今晚上才能试下
花如月 2011-09-07
  • 打赏
  • 举报
回复
恩,mysql数据库同步时,有些是把主服务器的信息写在配置文档my.cnf中,有的直接登录mysql执行‘change master’我有点搞不清楚
rucypli 2011-09-05
  • 打赏
  • 举报
回复
应该是没有权限 重新在master上设置一下复制权限

56,687

社区成员

发帖
与我相关
我的任务
社区描述
MySQL相关内容讨论专区
社区管理员
  • MySQL
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧