Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL slave I/O thread not running

I have set up replication for MySQL server. I can connect from the slave machine to 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 do I 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.*.

like image 424
Champ Avatar asked Jan 23 '23 00:01

Champ


1 Answers

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.

like image 104
brian-brazil Avatar answered Jan 31 '23 06:01

brian-brazil