报错内容如下:Got fatal error 1236 from master when reading data from binary log: 'Could not find first log file name in binary log index file'。
解决方法如下:1、
2、主机重启 service mysql restart ;
[root@n001db1 zxj]# service mysql restart;
3、找到主机的 bin_log位置
mysql> SHOW MASTER STATUS;
+------------------+----------+--------------+------------------+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+------------------+----------+--------------+------------------+
| mysql-bin.000001 | 107 | | |
+------------------+----------+--------------+------------------+
1 row in set (0.00 sec)
4、停止从机的主从关系: stop slave
mysql> stop slave;
Query OK, 0 rows affected (0.01 sec)
5、设置主从
mysql> change master to master_host='ip',master_port=端口,master_user='主从账户',master_password='主从账户密码',master_log_file='mysql-bin.000001',master_log_pos=107;
Query OK, 0 rows affected, 2 warnings (0.02 sec)
6、
启动主从关系。
mysql> start slave;
Query OK, 0 rows affected (0.63 sec)