reconnecting after a failed master event read.

So the error came due my MASTER HOST get changed and given the error: slave_io_state reconnecting after a failed master event read.

When we have checked the parameterSeconds_Behind_Masteron the slave status of the MySQL is showing more than 8 hours behind in seconds.

mysql> show slave status\G;

You can check the error you will get like “Reconnecting after a failed master event read” at the parameter SLAVE_IO_STATE.

So now we have to change the host into the slave, Let’s look at the step after we change the MASTER HOST.

STEP 1: Stop the MySQL server on Slave Environment.

tastethelinux-ashish@tla:~$sudo service mysql stop

STEP 2: Go to the directory /var/lib/mysql and check the file

tastethelinux-ashish@tla:~$cd /var/lib/mysql

So, the file contains important information like MASTER_UUID, MASTER_HOST, MASTER_USER, Master_Port, Master_Retry_Count, and many other entries has been there in this.

reconnecting after a failed master event read.
screenshot of the file in MySQL.

STEP 3: Take the Back of File

This is the most important part, if you make any changes in the file, please take the backup first.


STEP 4: Check the lines and make the changes in

So, we have to check the line in the for the safer side

tastethelinux-ashish@tla:~$sudo wc -l <

You guys can see I got the output as 22, Means I have 22 lines in the file.

NOTE: It can be different in your case.

Now, Let’s change the Domain name or the IP address.

tastethelinux-ashish@tla:~$sudo vim

In my case, the old IP Address is and my new address is

I have done with my changes and it’s time to save and quit the file.

You have to again check the line number by using the command wc -l < and that should be the same as the previous output that is 22.

STEP 5: Start the server without replication

tastethelinux-ashish@tla:~$service mysql start --skip-slave-start

After that login to the MySQL slave server and check the status of the MySQL.


You will see that the IP Address that you have changed is the same in the MASTER_HOST parameter.

Then we have to start the slave and check the status


Just have a look that the Seconds_Behind_Master has been decreasing.

Check out the error regarding error 1062 mysql duplicate entry and mysql incorrect timezone, Mysql Install on Linux(CentOS/Ubuntu)

change master host mysql replication, change master host, change master host ip, mysql change master host ip, mysql slave change master host, mysql replication slave_io_state connecting to master, mysql slave error connecting to master

Give your valuable time