MySQL replication dies with ERROR 1201 (HY000): Could not initialize master info structure
Posted by Admin • Friday, February 12. 2010 • Category: Linux
On a fine happy morning I am greeted with an alert that slave is not running. Running start slave yields this:
It's working fine again. Still don't know what caused this - possibly random remote server power cycling...
ERROR 1201 (HY000): Could not initialize master info structure; more error messages can be found in the MySQL error logEnabling 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)
- Next I followed instructions from the blog I mentioned above:
STOP SLAVE; RESET SLAVE; - Instead of fully reconfiguring I simply tried to start slave. This is a bad idea because it seems to just try to start slaving off the front of the first binlog file it finds, getting conflicts (or worse).
- So I tried something simple:
The position comes from the output I saved beforemysql> 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)
It's working fine again. Still don't know what caused this - possibly random remote server power cycling...
dude you are awesome..thanks alot