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

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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-01 13:35:05
Original
1903 people have browsed it

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
Related labels:
source:php.cn
Statement of this Website
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
Latest Issues
PHP parsing error: syntax error, unexpected '
From 1970-01-01 08:00:00
0
0
0
Report an error
From 1970-01-01 08:00:00
0
0
0
Error when uploading file format error
From 1970-01-01 08:00:00
0
0
0
html5 - EventSource error
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template