MariaDB 数据库复制失败 SQL_Errno 1062

MariaDB database replication fails with SQL_Errno 1062

我已经根据 these instructions 设置了 mariadb 复制。事情进展顺利。嗯,实际上主要是工作,就是这样。我不断提出与此类似的错误。

Last_SQL_Error: Error 'Duplicate entry '136-202' for key 'PRIMARY'' on query. Default database: 's7data'. Query: 'INSERT INTO history (uid, nid, timestamp) VALUES ('136', '202', '1446221969')'

Last_SQL_Errno: 1062

Last_SQL_Error: Error 'Duplicate entry 'links:main-menu:page:node/128/edit:en:1:1' for key 'PRIMARY'' on query. Default database: 's7data'. Query: 'INSERT INTO cache_menu (cid, serialized, created, expire, data) VALUES ('links:main-menu:page:node/128/edit:en:1:1', '1', '1446222020', '0', 'a:4:{s:9:\"min_depth\";i:1;s:9:\"max_depth\";i:1;s:8:\"expanded\";a:1:{i:0;i:0;}s:12:\"active_trail\";a:1:{i:0;i:0;}}')'

作为权宜之计,我尝试了 运行

stop slave; SET GLOBAL sql_slave_skip_counter = 100; start slave;

这行得通,但问题最终会再次出现。我可以跳过个别问题吗?

从 Master 重新导入数据库转储后

mysql -u <rootuser> -p database-target < db.dump.sql

我在主服务器上执行了 reset master,在从服务器上执行了

stop slave; reset slave; change master to .... start slave;

最后通过将此添加到 my.cnf 文件来添加跳过重复项,如 http://www.ducea.com/2008/02/13/mysql-skip-duplicate-replication-errors/

所解释
slave-skip-errors = 1062