110812 09:17:07 mysqld_safe mysqld from pid file /usr/local/mysql/var/sh-192-168-250-40.chinascopefinancial.com.pid ended
110812 09:18:53 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var
110812  9:18:54 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.
110812  9:18:54 [Note] Plugin 'FEDERATED' is disabled.
110812  9:18:54 [Note] Plugin 'ndbcluster' is disabled.
110812  9:18:54  InnoDB: Started; log sequence number 0 533427566
110812  9:18:54 [Note] Slave SQL thread initialized, starting replication in log 'mysql-bin.000713' at position 1017000578, relay log './relay-bin.000584' position: 251
110812  9:18:54 [Note] Slave I/O thread: connected to master '[email protected]:3306',replication started in log 'mysql-bin.000714' at position 889713764
110812  9:18:54 [Note] Event Scheduler: Loaded 0 events
110812  9:18:54 [Note] /usr/local/mysql/libexec/mysqld: ready for connections.
Version: '5.1.53-log'  socket: '/usr/local/mysql/tmp/mysql.sock'  port: 3306  Source distribution
110812  9:18:54 [ERROR] Slave SQL: Could not execute Write_rows event on table csf.tmp_excel_data; Duplicate entry '629-2.1.1-27-17-13487' for key 'PRIMARY', Error_code: 1062; handler error HA_ERR_FOUND_DUPP_KEY; the event's master log mysql-bin.000713, end_log_pos 1017000770, Error_code: 1062
110812  9:18:54 [Warning] Slave: Duplicate entry '629-2.1.1-27-17-13487' for key 'PRIMARY' Error_code: 1062
110812  9:18:54 [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.000713' position 1017000578
baidu,google了许多资料,但是不敢贸然下手,各位有经验的,告诉我如何一步步走,以便不要带来别的意外失误啊!

解决方案 »

  1.   

    step 1:
    select * from csf.tmp_excel_data where pkcol=''629-2.1.1-27-17-13487',if exists,goto step 2step2:
    run 
    slave stop;
    set sql_slave_skip_counter=1;
    slave start;
    show slave status \Gthen keep monitor the slave status.
      

  2.   


    执行这一步:select * from csf.tmp_excel_data where pkcol='629-2.1.1-27-17-13487';
    报错如下:
    Error Code: 1054. Unknown column 'pkcol' in 'where clause'
      

  3.   

    日志里面报错如下:110812 10:52:16 [Note] Slave I/O thread killed while reading event
    110812 10:52:16 [Note] Slave I/O thread exiting, read up to log 'mysql-bin.000715', position 557195988
    110812 10:52:31 [Note] Slave I/O thread: connected to master '[email protected]:3306',replication started in log 'mysql-bin.000715' at position 557195988
    110812 10:52:31 [Note] Slave SQL thread initialized, starting replication in log 'mysql-bin.000713' at position 1017000578, relay log './relay-bin.000584' position: 251
    110812 10:52:31 [Note] 'SQL_SLAVE_SKIP_COUNTER=1' executed at relay_log_file='./relay-bin.000584', relay_log_pos='251', master_log_name='mysql-bin.000713', master_log_pos='1017000578' and new position at relay_log_file='./relay-bin.000584', relay_log_pos='508', master_log_name='mysql-bin.000713', master_log_pos='1017000835'
    110812 10:52:31 [ERROR] Slave SQL: Could not execute Write_rows event on table csf.tmp_excel_data; Duplicate entry '629-2.1.1-27-18-13487' for key 'PRIMARY', Error_code: 1062; handler error HA_ERR_FOUND_DUPP_KEY; the event's master log mysql-bin.000713, end_log_pos 1017001027, Error_code: 1062
    110812 10:52:31 [Warning] Slave: Duplicate entry '629-2.1.1-27-18-13487' for key 'PRIMARY' Error_code: 1062
    110812 10:52:31 [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.000713' position 1017000835
      

  4.   

    110812 10:52:31 [ERROR] Slave SQL: Could not execute Write_rows event on table csf.tmp_excel_data;检查磁盘是否够空间,检查文件是否有权限。