Fix to modify hostname causes MySQL restart slave failed

Source: Internet
Author: User

Fix to modify hostname causes MySQL restart slave failed

(This happens only in the case where the slave information is present in the file, if there is no such problem in the table):

Sometimes we change the host name very early, after running for several months, suddenly system problems, restart the database, found that start slave not come. The Relay-log file name and offset are not found.

Workaround:

> Show Slave status\g Note the current execution to the Binlog filename of the Master and Binlog Pos:

1. Row ***************************

Slave_io_state:waiting for Master to send event

master_host:10.0.21.66

Master_user:rpl

master_port:3306

master_log_file:mysql-bin.000308

exec_master_log_pos:169761782


Then execute:

> Reset slave all;


Re-execute Change master:

> Change MASTER to

Master_host= ' 10.0.21.66 ',

Master_user= ' RPL ',

Master_password= ' RPL ',

master_port=3306,

Master_log_file= ' mysql-bin.000308 ',

master_log_pos=169761782;


Start slave:

> Start slave;

> Show Slave status\g




# # # # To avoid this, we just need to configure it in MY.CNF before we configure it from the library

Master_info_repository = TABLE

Relay_log_info_repository = TABLE

Relay_log_recovery = 1

Restart the database, and then configure Change master.


This article is from the "Vegetable Chicken" blog, please be sure to keep this source http://lee90.blog.51cto.com/10414478/1932684

Fix to modify hostname causes MySQL restart slave failed

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.