Yasar Arafath
Yasar Arafath

Reputation: 1

Mysql replication is not working

I'm using mysql 5.22 version for master and slave replication. when I execute the show slave status command it's showing slave_io_state as connecting. how to solve this problem.

Please help me the same.

Regards,

Yasar

Upvotes: 0

Views: 1130

Answers (2)

Mahesh Patil
Mahesh Patil

Reputation: 1551

If Slave I/O thread is showing Connecting to Master status check these things:

  1. Verify the privileges for the user being used for replication on the master.
  2. Check that the host name of the master is correct and that you are using the correct port to connect to the master. The port used for replication is the same as used for client network communication (the default is 3306). For the host name, ensure that the name resolves to the correct IP address.
  3. Check that networking has not been disabled on the master or slave. Look for the skip-networking option in the configuration file. If present, comment it out or remove it.
  4. If the master has a firewall or IP filtering configuration, ensure that the network port being used for MySQL is not being filtered.
  5. Check that you can reach the master by using ping or traceroute/tracert to reach the host.

Upvotes: 0

Jacob
Jacob

Reputation: 2061

From here-

run a "show master status" on the master DB. It will give you the correct values to update your slave with. From your slave status, it looks like your slave has successfully connected to the master and is awaiting log events. To me, this means your slave user has been properly set up, and has the correct access. It really seems like you just need to sync the correct log file position. Careful, because to get a good sync, you should probably stop the master, dump the DB, record the master log file positions, then start the master,import the DB on the slave, and finally start the slave in slave mode using the correct master log file pos. I've done this about 30 times, and if you don't follow those steps almost exactly, you will get a bad sync.

Else go through this(How to set up replication) again, to see if there are some config problem.

Upvotes: 1

Related Questions