views:

804

answers:

1

I have set up replication for MySql server. I can connect from the slave machine the master server using the replication user/password. I have got the slave sql thread running but the slave i/o thread is not running and the slave i/o status comes as empty when checked using 'show slave status'. What could be the problem ? How to solve this ? restarting the slave does not help. This was my bad: Instead of giving a 'replication slave' privilege to ., I was only giving it for my_db.*.

+1  A: 

Instead of giving a 'replication slave' privilege to ., I was only giving it for my_db.*.

Replication slave is only a global privilege (i.e. per-user only), this means that a command such as

GRANT REPLICATION SLAVE on mydb.* TO 'someuser'@'%';

has no effect as you can't grant it per-database/column/table.

The command you need to run is:

GRANT REPLICATION SLAVE on *.* TO 'someuser'@'%';

Then do a START SLAVE. You might also find it useful to look in the mysql error log.

I'd suggest a good read of the replication setup documentation, as it explains all of this in detail.