[ERROR] Slave I/O for channel ”: The slave I/O thread stops because a fatal error is encountered when it try to get the value of SERVER_ID variable from master. Error: , Error_code: 0
为了使mysql读写分离,降低网站延迟,需要搭建主从热备(主主热备)。
分别尝试了MySQL5.7.9,5.7.20版本,发现Slave_IO_Running:NO ,并一直报以上错误:
根据网上查询的建议,重启MySQL多次,未能解决。
经过查阅官方的bug记录发现,当slave账户权限不够无法获得master的一些信息时可能会导致这种错误
解决方式是在master节点进行授权并重启:
GRANT ALL PRIVILEGES ON . TO ‘slave’@’140.xxx.xxx.xxx’;
flush privileges;
这里注意一定要重启才能使授权生效。