MySQL master/slave configuration prompts Failed to initialize the master info structure error

Source: Internet
Author: User

Early in the morning, I received a MySQL custom language warning: replication interrupt. It seems that an error was reported during master-slave synchronization.
Log on to MySQL and run show slave status \ G to find that salve has stopped. Therefore, start slave and report the following error:

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

After searching, the solutions provided on the Internet are basically:

1. Execute reset slave;
② Re-execute change master:


Mysql> change master
-> 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;
③ Run start slave.

So I tried and found the same error. I followed the error message and read the error log:

160324 6:40:10 [ERROR] log *** glibc detected ***/data/mysql/bin/mysqld: upted 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 schedents: 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: upted 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: upted 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: upted 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: upted double-linked list: 0x00002ab038100ab0 *** listed in the index, but failed to stat
160324 9:37:47 [ERROR] Error counting relay log space

The following errors are frequently found:
 

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

So, I read the index info file under the MySQL data file directory, and found that the Centos64-relay-bin.index file contains an exception: MySQL master-slave error solution: Failed to initialize the master info structure

Normally, this file is correct only when the bin-log file name is recorded, for example:
 

/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

Therefore, rename the Centos64-relay-bin.index file mv, and then restart MySQL, re-follow the above steps taken from the Internet: reset, change master, start successfully done!
If you have encountered a similar problem, follow the three steps provided on the internet to try it. If the error is similar to this article, please take a special look at these files in the MySQL data directory:
Mysql-bin.index
Relay-log.info
Host Name-relay-bin.index
You can try to rename or remove them, restart MySQL, and perform the preceding three steps again!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.