心海恋歌 发表于 2018-9-28 14:07:15

mysql主从同步IO线程NO-love笨笨的博客

主从同步错误一例
  mysql> show slavestatus\G;
  ***************************1. row ***************************
  Slave_IO_State:
  Master_Host: 10.0.10.114
  Master_User: rep
  Master_Port: 3306
  Connect_Retry: 60
  Master_Log_File: mysql-bin.000024
  Read_Master_Log_Pos: 264

  >  Relay_Log_Pos: 4
  Relay_Master_Log_File: mysql-bin.000024
  Slave_IO_Running: No
  Slave_SQL_Running: Yes
  Replicate_Do_DB:
  。。。。。。。。。。(省略)。。。。。。
  Master_SSL_Verify_Server_Cert:No
  Last_IO_Errno: 1593

  Last_IO_Error: Fatal error: Theslave I/O thread stops becausemaster and slave have equal MySQL server>解决:
  # grep"server-id" /data/3306/my.cnf                #####主库
  server-id = 1
  #
  # grep"server-id" /data/3306/my.cnf         #####从库
  server-id = 1                                                   #####更改为3
  #
  # /data/3306/mysql restart
  Restarting MySQL...
  Stoping MySQL...
  Enter password:
  Starting MySQL...
  mysql> stop slave;
  Query OK, 0 rows affected (0.27 sec)
  mysql> CHANGE MASTER TO MASTER_HOST='10.0.10.114', MASTER_PORT=3306, MASTER_USER='rep',MASTER_PASSWORD='802352', MASTER_LOG_FILE='mysql-bin.000024',MASTER_LOG_POS=264;
  Query OK, 0 rows affected (0.01 sec)
  mysql> start slave;
  Query OK, 0 rows affected (0.01 sec)
  mysql> show slavestatus\G;
  ***************************1. row ***************************

  Slave_IO_State: Queueing masterevent to the>  Master_Host: 10.0.10.114
  Master_User: rep
  Master_Port: 3306
  Connect_Retry: 60
  Master_Log_File: mysql-bin.000028
  Read_Master_Log_Pos: 106

  >  Relay_Log_Pos: 251
  Relay_Master_Log_File: mysql-bin.000028
  Slave_IO_Running: Yes
  Slave_SQL_Running: Yes
  。。。。。。。。。(省略)。。。。。。。。。。。。。。
  Last_IO_Errno: 0
  Last_IO_Error:
  Last_SQL_Errno: 0
  Last_SQL_Error:
  1 row in set (0.02sec)
  ERROR:
  No query specified
  mysql>

页: [1]
查看完整版本: mysql主从同步IO线程NO-love笨笨的博客