Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

[Mysql] ERROR 1872 (HY000): Slave failed to initialize relay log info

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Background: after migrating the database directory to another k directory online, the slave process reports an error:

Start slave

ERROR 1872 (HY000): Slave failed to initialize relay log info structure from the repository

Solution:

Modify the records in the index file and info file index to be [root@Yun-MySQL02 3306] # more mysqlrelay.index of the original directory

/ data/mydata/3306/mysqlrelay.000006-modify it to the new relay log directory

/ databak/3306/mysqlrelay.000007

/ databak/3306/mysqlrelay.000008

/ databak/3306/mysqlrelay.000009

/ databak/3306/mysqlrelay.000010

[root@Yun-MySQL02 3306] # more relay-log.info

seven

/ databak/3306/mysqlrelay.000007-modify to the new relay log directory

29378841

Mysql-bin.000051

706927394

0

0

one

Note: there may be environments where relay-log.info cannot be found because of parameter settings

Before MySQL 5.6.2, the master information recorded by slave and the information of slave application binlog were stored in files, namely master.info and relay-log.info. After version 5.6.2, logging is allowed in table with the following parameters:

Master-info-repository = TABLE-FILE means as a file

Relay-log-info-repository = TABLE-FILE means as a file

The corresponding tables are mysql.slave_master_info and mysql.slave_relay_log_info, and both tables are innodb engine tables.

Mysql > select * from mysql.slave_master_info\ G:

* * 1. Row *

Number_of_lines: 23

Master_log_name: mysql-bin.000129

Master_log_pos: 760146983

Host: 192.168.10.1

User_name: repl

User_password: aaafdffdgbh_$3KFUH

Port: 3307

Connect_retry: 60

Enabled_ssl: 0

Ssl_ca:

Ssl_capath:

Ssl_cert:

Ssl_cipher:

Ssl_key:

Ssl_verify_server_cert: 0

Heartbeat: 1800

Bind:

Ignored_server_ids: 0

Uuid: 6c8a10ed-ed0b-11e4-91eb-00163ec546aa

Retry_count: 86400

Ssl_crl:

Ssl_crlpath:

Enabled_auto_position: 1

1 row in set (0.07 sec)

Mysql > show variables like 'relay%'

+-+

| | Variable_name | Value |

+-+

| | relay_log | / databak/3306/mysqlrelay |

| | relay_log_basename | / databak/3306/mysqlrelay |

| | relay_log_index | / databak/3306/mysqlrelay.index |

| | relay_log_info_file | relay-log.info |

| | relay_log_info_repository | FILE |

| | relay_log_purge | ON |

| | relay_log_recovery | OFF |

| | relay_log_space_limit | 0 | |

+-+

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report