Afficher un message
Vieux 27/04/2006, 22h33   #2
Gordon Burditt
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Replication; Duplicate Entry on Update?

>How can I receive a 'duplicate entry' error for an UPDATE? An update isn't
>creating an entry, so why this error message?


If you modify a column that has a unique key so that the new value
is not unique, you can get that error.

>060427 11:57:23 [Note] Slave SQL thread initialized, starting replication in
>log 'kiosk1-bin.000006' at position 7233, relay log
>'./royaldemo-2-relay-bin.000007' position: 7321
>060427 11:57:23 [ERROR] Slave: Query caused different errors on master and
>slave. Error on master: 'Duplicate entry '%-.64s' for key %d' (1062), Error
>on slave: 'no error' (0). Default database: 'rccl'. Query: 'UPDATE pages SET
>`created_at` = '2006-04-26 14:43:04', `template_id` = 4, `ordernum` = 10,
>`location_id` = 4, `user_id` = 1, `serverid` = 10, `name` = 'Trolly 4' WHERE
>id = 92', Error_code: 0
>060427 11:57:23 [ERROR] Error running query, slave SQL thread aborted. Fix
>the problem, and restart the slave SQL thread with "SLAVE START". We stopped
>at lo
>g 'kiosk1-bin.000006' position 45142


It looks here like your replication is out of sync. Your master had
a duplicate record, the slave didn't.

Gordon L. Burditt

  Réponse avec citation
 
Page generated in 0,05179 seconds with 9 queries