1 Could not execute Write_rows event on table cs3.test01; Duplicate entry ‘7‘ for key ‘test01.PRIMARY‘
1.1 主库操作
SHOW BINARY LOGS; PURGE BINARY LOGS TO 'binlog.000001'; RESET MASTER;
1.2 从库操作
STOP SLAVE; CHANGE MASTER TO MASTER_HOST='192.168.203.141', MASTER_PORT=33060,MASTER_USER='root', MASTER_PASSWORD='123456'; START SLAVE;
2 主从同步遇到 Got fatal error 1236 from master when reading data from binary log: 'Could not find first log...
1.打开主服务器,进入mysql
2.执行flush logs;//这时主服务器会重新创建一个binlog文件;
3.来到从服务器的mysql;
4.stop slave;
5.change master to master_log_file='mysql-bin.000012',master_log_pos=154;//这里的file和pos都是上面主服务器master显示的。
6.start slave;//这时候就应可以了
7.show slave status G;