mysql同步error(Slave_IO_Running: )error connecting to master

miaomiao_j 2012-11-08 02:32:46
mysql> show slave status\G
*************************** 1. row ***************************
Slave_IO_State:
Master_Host: 10.10.10.2
Master_User: hnhl
Master_Port: 5595
Connect_Retry: 0
Master_Log_File: mysql-bin.000030
Read_Master_Log_Pos: 106
Relay_Log_File: mysqld-relay-bin.000001
Relay_Log_Pos: 4
Relay_Master_Log_File: mysql-bin.000030
Slave_IO_Running: No
Slave_SQL_Running: Yes
Replicate_Do_DB: hc9
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 0
Last_Error:
Skip_Counter: 1
Exec_Master_Log_Pos: 106
Relay_Log_Space: 106
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: Yes
Master_SSL_CA_File: 60
Master_SSL_CA_Path: 0
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 'hnhl@10.10.10.2:5595' - retry-time: 0 retries: 86400
Last_SQL_Errno: 0
Last_SQL_Error:
1 row in set (0.00 sec)


已经授权了
...全文
1559 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
miaomiao_j 2012-11-10
  • 打赏
  • 举报
回复

mysql> show slave status\G
*************************** 1. row ***************************
               Slave_IO_State:
                  Master_Host: 10.10.10.2
                  Master_User: tongbu
                  Master_Port: 5595
                Connect_Retry: 0
              Master_Log_File: mysql-bin.000032
          Read_Master_Log_Pos: 106
               Relay_Log_File: mysqld-relay-bin.000003
                Relay_Log_Pos: 4
        Relay_Master_Log_File: mysql-bin.000032
             Slave_IO_Running: No
            Slave_SQL_Running: Yes
              Replicate_Do_DB: hc9
          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: 106
              Relay_Log_Space: 106
              Until_Condition: None
               Until_Log_File:
                Until_Log_Pos: 0
           Master_SSL_Allowed: Yes
           Master_SSL_CA_File: 60
           Master_SSL_CA_Path: 0
              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 'tongbu@10.10.10.2:5595' - retry-time: 0  retries: 86400
               Last_SQL_Errno: 0
               Last_SQL_Error:
1 row in set (0.00 sec)



miaomiao_j 2012-11-10
  • 打赏
  • 举报
回复
mysql> show slave status\G *************************** 1. row *************************** Slave_IO_State: Master_Host: 10.10.10.2 现在是 这里 Slave_IO_State: 老是 空的 不管我 启动了 slave 还是没有启动。 其他都没有问题 防火墙、bind-address=127.0.0.1、 mysql> show grants for 'tongbu'@'10.10.10.5'; +-------------------------------------------------------------------------------------------------------------------------------------------+ | Grants for tongbu@10.10.10.5 | +-------------------------------------------------------------------------------------------------------------------------------------------+ | GRANT ALL PRIVILEGES ON *.* TO 'tongbu'@'10.10.10.5' IDENTIFIED BY PASSWORD '*8B92DE6FD7FF34D1697AE23187B488DD057B8D41' WITH GRANT OPTION | +-------------------------------------------------------------------------------------------------------------------------------------------+ 1 row in set (0.00 sec)
wwwwb 2012-11-08
  • 打赏
  • 举报
回复
去掉可以远程登录
miaomiao_j 2012-11-08
  • 打赏
  • 举报
回复
bind-address=127.0.0.1 这个 在做 master、slave时具体起到什么作用啊 大侠
引用 2 楼 WWWWA 的回复:
1、在A机器上直接登录MYSQL,然后SHOW VARIABLES LIKE '%PORT%',看看用的是哪个端口。或者在配置文件的MYSQLD下的PORT参数,看下是多少,如果不是3306,那么你B里指定的MASTER的端口肯定就是错误的。 2、确定能够登录A本机后,看下同步账号的权限是否足够 mysql> show grants for '同步账号'; ……
WWWWA 2012-11-08
  • 打赏
  • 举报
回复
1、在A机器上直接登录MYSQL,然后SHOW VARIABLES LIKE '%PORT%',看看用的是哪个端口。或者在配置文件的MYSQLD下的PORT参数,看下是多少,如果不是3306,那么你B里指定的MASTER的端口肯定就是错误的。 2、确定能够登录A本机后,看下同步账号的权限是否足够 mysql> show grants for '同步账号'; 3、在B机登录A机,通过同步账号这个账号。 4、在B机上操作1,2,3步,确定都正常。 5、在my.cnf(INI)中是否有bind-address=127.0.0.1,如有,去掉。
ACMAIN_CHM 2012-11-08
  • 打赏
  • 举报
回复
直接在你的机器上用相同的账号测试一下是能够连接主机。
Master configuration Find the my.cnf file Configure under [mysqld] [mysqld] server-id=1 log-bin=master-bin   Restart the service and log in to mysql Create a user to obtain the log file. mysql> CREATE USER 'sree'@'%' IDENTIFIED BY 'sree' Grant relevant permissions (copy permissions) *.* represents all tables in all libraries mysql> grant replication slave on *.* to 'sree'@'%'   Refresh permissions mysql> flush privileges mysql> show master status; | File | Position | master-bin.000004 | 120                      Slave configuration ==================== Modify the configuration file: Configure under [mysqld] [mysqld] server-id=2 #As long as it is different from the above.   Then log in to mysql mysql>  CHANGE MASTER TO     MASTER_LOG_FILE='master-bin.000004 ', #above file        MASTER_LOG_POS = 120 ; #The above position        MASTER_HOST='192.168.249.130', #The ip address of the main library         MASTER_USER = 'sree',         MASTER_PASSWORD = 'sree',  Then start slave ============ mysql> show slave status\G; see: ===  Slave_IO_Running: Yes  Slave_SQL_Running: Yes It means that it was successful.     Errors in the whole process: Slave_IO_Running: Connecting 1. Mine is the wrong host ip. 2. There are still some firewalls on the Internet that are not turned off I use centos7 to turn off the firewall: systemctl stop firewalld 3. There is also a mistake in the above-mentioned secret.   Fatal error: The slave I/O thread stops because master and slave have equal MySQL server UUIDs This error generally occur when we clone the master to slaver. Delete auto.cnf of mysql, and then restart the service.

56,677

社区成员

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

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