您的位置:首页 > 数据库 > MySQL

mysql主从复制Slave_IO_Running: No错误

2012-05-23 17:17 591 查看
[align=center] mysql主从复制Slave_IO_Running: No错误[/align]
[align=left]在从服务器上show slave status\G;[/align]
[align=left]mysql> show slave status\G;
*************************** 1. row ***************************
Slave_IO_State: Connecting to master
Master_Host: 10.11.5.225
Master_User: slave
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000005
Read_Master_Log_Pos: 362
Relay_Log_File: mysqld-relay-bin.000001
Relay_Log_Pos: 98
Relay_Master_Log_File: mysql-bin.000005
Slave_IO_Running: No
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: 362
Relay_Log_Space: 98
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
1 row in set (0.00 sec)[/align]
[align=left]ERROR:
No query specified[/align]
[align=left]问题所在:[/align]
[align=left]1.服务器进行授权访问权限问题,解决方法:[/align]
[align=left] mysql> grant replication slave on *.* to slave@10.11.5.170 identified by ‘123‘;[/align]
[align=left]2.master_log_file和binlog_log_pos不一致,解决方法:[/align]
[align=left]在主服务器上show master status;看下日志文件名和位置[/align]
[align=left]在从服务器上slave stop;[/align]
[align=left] mysql> stop slave;[/align]
mysql> change master to master_log_file='mysql-bin.000008',master_log_pos=98;

mysql> start slave;
3.互为主从的服务器有一台slave未正常启动,解决方法:
change master to master_host='10.11.5.170';
4.两台服务器是否在同一网段,iptables是否把3306端口关了。本文出自 “tonylinux” 博客,请务必保留此出处http://tonylinux.blog.51cto.com/2268300/874761
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: