Home >Database >Mysql Tutorial >mysql数据同步1062错误:Error 'Duplicate_MySQL

mysql数据同步1062错误:Error 'Duplicate_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-01 13:35:051907browse

bitsCN.com

mysql数据同步1062错误:Error 'Duplicate

 

发现数据同步出错,提示一下内容:

 

 Last_SQL_Errno: 1062

 Last_SQL_Error: Error 'Duplicate entry 'test' for key 'username'' on query. Default database: 'data'. Query: 'INSERT INTO `member`(`username`,`password`,`email`,`modelid`,`groupid`) VALUES('test','cc03e747a6afbbcbf8be7668acfebee5','test@163.com','10','5')'

  Replicate_Ignore_Server_Ids: Master_Server_Id: 1

 

分几步尝试:

 

一、关闭后重启同步试试看

 

二、跳过同步出错的地方,

 

1:停止SLAVE 服务

mysql> STOP SLAVE;

 

2:设置跳过的EVENT个数

mysql> SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;

 

3:启动SLAVE服务

mysql> START SLAVE;

 

三、修改mysql的配置文件,/etc/my.cnf,在[mysqld]下面添加一行

slave_skip_errors = 1062 这里是跳过所有的1062错误了

bitsCN.com
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn