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...