List:General Discussion« Previous MessageNext Message »
From:Rick James Date:November 30 2012 10:52pm
Subject:RE: MySQL Replication Error
View as plain text  
Possible causes:
* Someone is writing to the Slave.
* The Slave was not in synch with the Master.
* Schemas are different between Master and Slave.
* Someone is changing the POS for replication.

After you have eliminated those possibilities, provide
SHOW CREATE TABLE (for a table that is in trouble)

> -----Original Message-----
> From: Néstor [mailto:rotsen@stripped]
> Sent: Friday, November 30, 2012 1:24 PM
> To: mysql@stripped
> Subject: MySQL Replication Error
> I am trying to set up mysql replication on 2 systems but Once I get it
> going, I get the following an error 1062, which is a duplicate entry
> and my 'slave status' shows:
>           Slave_IO_Running: Yes
>           Slave_SQL_Running: No
> And this is the error on my mysql.err file:
> 121130 12:41:53 [Note] Slave I/O thread killed while reading event
> 121130 12:41:53 [Note] Slave I/O thread exiting, read up to log 'mysql-
> bin.000266', position 76841310
> 121130 12:41:57 [Note] Slave SQL thread initialized, starting
> replication in log 'mysql-bin.000265' at position 99071761, relay log
> '/var/log/mysql/mysql-relay-bin.000006' position: 98589371
> 121130 12:41:57 [Note] Slave I/O thread: connected to master '
> sdcwa_slave@stripped:3306',  replication started in log 'mysql-
> bin.000266' at position 76841310
> 121130 12:41:57 [ERROR] Slave: Error 'Duplicate entry 'links:primary-
> links:tree-data:7b7216a15969aa93e5dfb9aaa24bfc32' for key 1'
> on query. Default database: 'parallax'. Query: 'INSERT INTO cache_menu
> (cid, data, created, expire, headers, serialized) VALUES
> ('links:primary-links:tree-data:7b7216a15969aa93e5dfb9aaa24bfc32',
> 'a:2:{s:4:\"tree\";a:19:{i:310;a:2:{s:4:\"link\";a:38:{s:14:\"load_func
> tions\";s:26:\"a:1:{i:1;s:9:\"node_load\";}\";s:16:\"to_arg_functions\"
> ;s:0:\"\";s:15:\"access_callback\";s:11:\"node_access\";s:16:\"access_a
> rguments\";s:29:\"a:2:{i:0;s:4:\"view\";i:1;i:1;}\";s:13:\"page_callbac
> k\";s:14:\"node_page_view\";s:14:\"page_arguments\";s:14:\"a:1:{i:0;i:1
> ;}\";s:5:\"title\";s:0:\"\";s:14:\"title_callback\";s:15:\"node_page_ti
> tle\";s:15:\"title_arguments\";s:14:\"a:1:{i:0;i:1;}\";s:4:\"type\";s:1
> :\"4\";s:11:\"description\";s:0:\"\";s:9:\"menu_name\";s:13:\"primary-
> links\";s:4:\"mlid\";s:3:\"310\";s:4:\"plid\";s:1:\"0\";s:9:\"link_path
> \";s:7:\"node/14\";s:11:\"router_path\";s:6:\"node/%\";s:10:\"link_titl
> e\";s:11:\"Wh
> 121130 12:41:57 [ERROR] Error running query, slave SQL thread aborted.
> Fix the problem, and restart the slave SQL thread with "SLAVE START".
> We stopped at log 'mysql-bin.000265' position 99451408
> I done searches on google and I look at several sites and basically
> they say to do the following:
> mysql> stop slave;
> mysql> SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1; start slave; show slave
> mysql> status\G
> But after doing this a couple of minutes later I get the same situation
> I have re-installed the database on the slave also to see if this fixes
> the problem but after a few minutes I get the same error.  I have
> repeated the replication from the beginning but I get the same problem
> after a while.
> Does anyone know a way to fix this?
> Thanks,
> Néstor
MySQL Replication ErrorNéstor30 Nov
  • RE: MySQL Replication ErrorRick James30 Nov
    • Re: MySQL Replication ErrorReindl Harald30 Nov
      • Re: MySQL Replication Errordivesh kamra5 Dec
        • Re: MySQL Replication ErrorJohan De Meersman5 Dec
          • Re: MySQL Replication ErrorNéstor6 Dec
  • Re: MySQL Replication ErrorManuel Arostegui5 Dec
    • Re: MySQL Replication ErrorNéstor6 Dec
      • Re: MySQL Replication ErrorIgor Shevtsov6 Dec
      • Re: MySQL Replication ErrorIgor Shevtsov6 Dec
      • Re: MySQL Replication ErrorJohan De Meersman10 Dec
Re: MySQL Replication ErrorNéstor7 Dec
  • Re: MySQL Replication ErrorIgor Shevtsov7 Dec