The problem is generally caused by the relay log not being defined in the configuration file.
1, Problem Description:
mysql> start slave;
ERROR 1872 (HY000): Slave failed to initialize relay log info structure from the repository
mysql> System Perror 1872
MySQL error code 1872 (er_slave_rli_init_repository): SLAVE failed to initialize relay log info structure from the Reposit Ory
2. Treatment methods
2.1. Modify the configuration file
For example, add the following entry in the MY.CNF configuration file:
Relay_log =/opt/mysql/logs/mysql-relay-bin
Restart the MySQL instance for it to take effect.
2.2. Reconnect Master
mysql> stop Slave;
Query OK, 0 rows affected, 1 Warning (0.00 sec)
mysql> Change Master to master_host= ' 192.168.2.10 ', master_user= ' repl_user ', master_password= ' 123456 ', Master_log_ File= ' mysql-bin.000002 ', master_log_pos=821301;
Query OK, 0 rows affected, 2 warnings (0.00 sec)
mysql> start slave;
ERROR 1872 (HY000): Slave failed to initialize relay log info structure from the repository
The problem remains after reconnecting.
2.3. Reset Slave
mysql> Reset Slave;
Query OK, 0 rows Affected (0.00 sec)
mysql> Change Master to master_host= ' 192.168.2.10 ', master_user= ' repl_user ', master_password= ' 123456 ', Master_log_ File= ' mysql-bin.000002 ', master_log_pos=821301;
Query OK, 0 rows affected, 2 warnings (0.02 sec)
mysql> start slave;
Query OK, 0 rows affected (0.12 sec)
Check the slave status again:
Mysql> show Slave status\g;
1. Row ***************************
Slave_io_state:waiting for Master to send event
master_host:192.168.2.10
Master_user:repl_user
master_port:3306
Connect_retry:60
master_log_file:mysql-bin.000002
read_master_log_pos:824989
relay_log_file:mysql-relay-bin.000002
relay_log_pos:3971
relay_master_log_file:mysql-bin.000002
Slave_io_running:yes
Slave_sql_running:yes
.......
Problem solving.
ERROR 1872 (HY000): Slave failed to initialize relay log info structure from the repository