云自无心水自闲

天平山上白云泉,云自无心水自闲。何必奔冲山下去,更添波浪向人间!
posts - 288, comments - 524, trackbacks - 0, articles - 6
  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

Mysql replication error 1201

Posted on 2012-11-18 20:23 云自无心水自闲 阅读(598) 评论(0)  编辑  收藏
Mysql replication error 1201
On a fine happy morning I am greeted with an alert that slave is not running. Running start slave yields this:
ERROR 1201 (HY000): Could not initialize master info structure; more error messages can be found in the MySQL error log
Enabling the log yielded nothing. Googling yielded This Page that helped me a lot, but I didn't have to do quite as much work all over again. Here is what I did.
First, I saved my "SHOW SLAVE STATUS\G" output:
************************** 1. row **************************
             Slave_IO_State:
                Master_Host: 127.0.0.1
                Master_User: replication
                Master_Port: 3307
              Connect_Retry: 60
            Master_Log_File: mysqld-bin.000401
        Read_Master_Log_Pos: 98
             Relay_Log_File: mysqld-relay-bin.006135
              Relay_Log_Pos: 242
      Relay_Master_Log_File: mysqld-bin.000401
           Slave_IO_Running: No
          Slave_SQL_Running: No
            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: 98
            Relay_Log_Space: 0
            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)
STOP SLAVE; RESET SLAVE;
mysql> CHANGE MASTER TO MASTER_LOG_POS=98 , MASTER_LOG_FILE = 'mysqld-bin.000401';
Query OK, 0 rows affected (0.04 sec)
mysql> start slave;
Query OK, 0 rows affected (0.00 sec)
    
The position comes from the output I saved before
It's working fine again. Still don't know what caused this - possibly random remote server power cycling...



只有注册用户登录后才能发表评论。


网站导航: