Sometimes you just don’t want to do anything if a key already exists in the DB.
mysql> INSERT INTO `table` SET id=5, name=`arthur` ON DUPLICATE KEY UPDATE 0+0;
When checking how far behind from the master your slave has fallen, you may encounter this error:
ERROR 1227 (42000): Access denied; you need the SUPER,REPLICATION CLIENT privilege for this operation
Grant the SUPER privilege to your user and it will work:
mysql> GRANT SUPER ON *.* TO 'root'@'10.1.19.179' IDENTIFIED BY 'password';
mysql> SHOW SLAVE STATUS\G
******************** 1. row *********************
Slave_IO_State: Waiting for master to send event
Master_Host: localhost
Master_User: root
Master_Port: 3306
Connect_Retry: 3
Master_Log_File: gbichot-bin.005
Read_Master_Log_Pos: 79
Relay_Log_File: gbichot-relay-bin.005
Relay_Log_Pos: 548
Relay_Master_Log_File: gbichot-bin.005
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Replicate_Do_DB:
Replicate_Ignore_DB:
Last_Errno: 0
Last_Error:
Skip_Counter: 0
Exec_Master_Log_Pos: 79
Relay_Log_Space: 552
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: No
Master_SSL_CA_File:
Master_SSL_CA_Path:
Master_SSL_Cert:
Master_SSL_Cipher:
Master_SSL_Key:
Seconds_Behind_Master: 8
© 2007-2013 Bottomless, Inc. All Rights Reserved