处理一则MySQL Slave环境出现ERROR 1201 (HY000): Could not initialize master info structure的案例
mysql> start slave; ERROR 1872 (HY000): Slave failed to initialize relay log info structure from the repository
120326 11:10:23 [ERROR] /usr/local/mysql//libexec/mysqld: File ‘/data/mysqldata/3306/binlog/mysql-relay-bin.000002‘ not found (Errcode: 2) 120326 11:10:23 [ERROR] Failed to open log (file ‘/data/mysqldata/3306/binlog/mysql-relay-bin.000002‘, errno 2) 120326 11:10:23 [ERROR] Failed to open the relay log ‘/data/mysqldata/3306/binlog/mysql-relay-bin.000002‘ (relay_log_pos 126074557) 120326 11:10:23 [ERROR] Could not open log file 120326 11:10:23 [ERROR] Failed to initialize the master info structure
mysql> reset slave; Query OK, 0 rows affected (0.01 sec) mysql> change master to -> master_host=‘10.0.0.101‘, -> master_port=3306, -> master_user=‘repl‘, -> master_password=‘repl‘, -> master_log_file=‘mysql-bin.000011‘, -> master_log_pos=1;
mysql> change master to -> master_host=‘10.0.0.101‘, -> master_port=3306, -> master_user=‘repl‘, -> master_password=‘repl‘, -> master_log_file=‘mysql-bin.000011‘, -> master_log_pos=1; ERROR 1201 (HY000): Could not initialize master info structure; more error messages can be found in the MySQL error log
120326 11:14:27 [ERROR] Error reading master configuration 在操作系统端查看master/slave的配置文件,发现是两个0字节文件: -rw-rw---- 1 mysql mysql 0 Mar 26 11:13 master.info -rw-rw---- 1 mysql mysql 0 Mar 26 11:13 relay-log.info
mysql> change master to -> master_host=‘10.0.0.101‘, -> master_port=3306, -> master_user=‘repl‘, -> master_password=‘repl‘, -> master_log_file=‘mysql-bin.000011‘, -> master_log_pos=1; Query OK, 0 rows affected (0.00 sec)
mysql> start slave; Query OK, 0 rows affected (0.00 sec) mysql> show slave status\G *************************** 1. row *************************** Slave_IO_State: Waiting for master to send event Master_Host: 10.0.0.101 Master_User: repl Master_Port: 3306 Connect_Retry: 60 Master_Log_File: mysql-bin.000011 Read_Master_Log_Pos: 101
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。