教程集 www.jiaochengji.com
教程集 >  数据库  >  mysql  >  正文 MySQL主从配置提示Failed to initialize the master info structure错误

MySQL主从配置提示Failed to initialize the master info structure错误

发布时间:2017-12-09   编辑:jiaochengji.com
教程集为您提供MySQL主从配置提示Failed to initialize the master info structure错误等资源,欢迎您收藏本站,我们将为您提供最新的MySQL主从配置提示Failed to initialize the master info structure错误资源
MySQL主从配置可以实现数据热备份了,今天我们来看在使用主从配置时碰到Failed to initialize the master info structure错误提示问题的解决办法。

大清早收到一个MySQL的自定义语言告警 :replication interrupt,看来是主从同步报错了。
登陆MySQL,执行 show slave status \G 发现salve已经停止了,于是使用 start slave启动,结果有如下报错:

ERROR 1201 (HY000): Could not initialize master info structure; more error messages can be found in the MySQL error log

搜索了下,网上给出的解决办法基本都是:

①、执行 reset slave;
②、重新执行 change master:


mysql> change master to
    -> master_host='192.168.1.100',
    -> master_port=3306,
    -> master_user='repl',
    -> master_password='repl',
    -> master_log_file='mysql-bin.000051',
    -> master_log_pos=254105;
③、执行 start slave

于是试了下,发现还是一样的报错,顺着报错信息,看了下error 日志:

160324  6:40:10 [ERROR] log *** glibc detected *** /data/mysql/bin/mysqld: corrupted double-linked list: 0x00002ab038100ab0 *** listed in the index, but failed to stat
160324  6:40:10 [ERROR] Error counting relay log space
160324  6:40:10 [ERROR] Failed to initialize the master info structure
160324  6:40:10 [Note] Event Scheduler: Loaded 0 events
160324  6:40:10 [Note] /data/mysql/bin/mysqld: ready for connections.
Version: '5.5.13-log'  socket: '/data/mysql/data/mysqld.sock'  port: 3306  Source distribution
160324  9:33:41 [ERROR] log *** glibc detected *** /data/mysql/bin/mysqld: corrupted double-linked list: 0x00002ab038100ab0 *** listed in the index, but failed to stat
160324  9:33:41 [ERROR] Error counting relay log space
160324  9:33:54 [ERROR] log *** glibc detected *** /data/mysql/bin/mysqld: corrupted double-linked list: 0x00002ab038100ab0 *** listed in the index, but failed to stat
160324  9:33:54 [ERROR] Error counting relay log space
160324  9:35:29 [ERROR] log *** glibc detected *** /data/mysql/bin/mysqld: corrupted double-linked list: 0x00002ab038100ab0 *** listed in the index, but failed to stat
160324  9:35:29 [ERROR] Error counting relay log space
160324  9:37:47 [ERROR] log *** glibc detected *** /data/mysql/bin/mysqld: corrupted double-linked list: 0x00002ab038100ab0 *** listed in the index, but failed to stat
160324  9:37:47 [ERROR] Error counting relay log space

发现其中频繁出现如下错误:
 

ist: 0x00002ab038100ab0 *** listed in the index, but failed to stat

于是,把MySQL 数据文件目录下的 index info 文件都看了一遍,结果发现 Centos64-relay-bin.index文件中出现异常内容:MySQL主从报错解决:Failed to initialize the master info structure

这个文件正常情况应该是记录了 bin-log文件名称才对,比如:
 

./Centos64-relay-bin.002064
./Centos64-relay-bin.002065
./Centos64-relay-bin.002066
./Centos64-relay-bin.002067
./Centos64-relay-bin.002068
./Centos64-relay-bin.002069
./Centos64-relay-bin.002070

因此,将 Centos64-relay-bin.index 这个文件mv 重命名,然后重启MySQL,重新按照上文从网上照来的的步骤:reset、change master、start 成功搞定!
如果你也遇到类似问题,可以先按照网上提供的三个步骤试试,如果还是和本文类似的报错,请特别看下MySQL数据目录下的这几种文件:
mysql-bin.index
relay-log.info
主机名-relay-bin.index
可以尝试将他们重命名或移走,重启MySQL再走一遍上面的三个步骤应该可以搞定了!

您可能感兴趣的文章:
MySQL主从配置提示Failed to initialize the master info structure错误
bat脚本 git pull_Git遇到错误时如何解决的一些坑
MySQL主从配置中RESET SLAVE和RESET MASTER的区别详解
mysql5.1.34主从复制教程
搭建Mysql MHA高可用集群 各种报错解决
简单配置mysql的主从复制
mysql主从配置的三个错误及解决方法(图文)
php Fatal error: session_start(): Failed to initialize storage module: files
解决Mysql主从同步的Last_IO_Errno:1236错误问题
MySQL 搭建主从同步,从报 Slave can not handle replication events with

[关闭]
~ ~