1、由于binlog日志带多删除了几个后发现MySQL主从不同步
mysql> show slave statusG;
Slave_IO_Running: No
Slave_SQL_Running: Yes
查看报错日志为
[ERROR] Slave I/O: Got fatal error 1236 from master when reading data from binary log: "Could not find first log file name in binary log index file",
解决方式
从服务器配置:
主服务器查看
mysql> show master status;
+------------------+----------+--------------+------------------+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+------------------+----------+--------------+------------------+
| mysql-bin.000005 | 106 | | |
+------------------+----------+--------------+------------------+
1 row in set (0.00 sec)
从服务器设置
mysql> change master to master_host="192.168.0.10",master_user="replication",master_password="replication",master_log_file="mysql-bin.000003",master_log_pos=106;
Query OK, 0 rows affected (0.03 sec)
mysql>stop slave;
mysql>start slave;
主服务器配置
从服务器上查看
mysql> show master status;
+------------------+----------+--------------+------------------+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+------------------+----------+--------------+------------------+
| mysql-bin.000005 | 106 | | |
+------------------+----------+--------------+------------------+
1 row in set (0.00 sec)
主服务器配置
mysql> change master to master_host="192.168.0.11",master_user="replication",master_password="replication",master_log_file="mysql-bin.000005",master_log_pos=106;
Query OK, 0 rows affected (0.03 sec)
mysql>stop slave;
mysql>start slave;
在查看slave状态ok解决。Oracle select 语句字段连接MySQL主从同步部署相关资讯 MySQL主从 MySQL主从不同步
- MySQL主从环境下存储过程,函数, (今 07:26)
- 在 CentOS7 上部署 MySQL 主从 (08月20日)
- 恢复MySQL主从数据一致性的总结 (12/29/2015 22:14:15)
| - XtraBackup构建MySQL主从环境 (09月01日)
- MySQL主从失败使用bin-log恢复 (02月20日)
- MySQL5.6 主从复制配置 (12/21/2015 19:10:09)
|
本文评论 查看全部评论 (0)