Hi all, I receive this error in my slave mysql server. Slave_SQL_Running: No . How do i resolve it? Any suggestion ? Thank you. Error: mysql> show slave status \G; *************************** 1. row *************************** Master_Host: 172.16.1.61 Master_User: slave Master_Port: 3306 Connect_retry: 120 Master_Log_File: mysql-bin.097 Read_Master_Log_Pos: 5762958 Relay_Log_File: db02-relay-bin.003 Relay_Log_Pos: 851105522 Relay_Master_Log_File: mysql-bin.029 Slave_IO_Running: Yes Slave_SQL_Running: No Replicate_do_db: w00094 Replicate_ignore_db: Last_errno: 1062 Last_error: Error 'Duplicate entry '35355' for key 1' on query. Default database: 'w00094'. Query: 'INSERT INTO memberlog (mbl_id, mbl_mbsid, mbl_mbgid, mbl_username, mbl_sessid, mbl_ip, mbl_lastactive, mbl_logintime, mbl_logouttime) VALUES ('35355', '0', '0', '181005', '16eca303eca5ada57e8eb4606f887d5c', '202.93.220.32', '0', '1262244214', '0')' Skip_counter: 0 Exec_master_log_pos: 36065652 Relay_log_space: 12234531612 1 row in set (0.00 sec) ERROR: No query specified
You have already a record with PRIMARY KEY value of 35355 in table memberlog. There are 2 options to resolve this issue 1. DELETE the existing record from the table memberlog with PRIMARY KEY value memberlog. 2. Or skip the INSERT query from binlog with the following query SET GLOBAL sql_slave_skip_counter = 1; and restart the slave. If the existing record is not identical to the record being inserted INSERT INTO memberlog (mbl_id, mbl_mbsid, mbl_mbgid, mbl_username, mbl_sessid, mbl_ip, mbl_lastactive, mbl_logintime, mbl_logouttime) VALUES ('35355', '0', '0', '181005', '16eca303eca5ada57e8eb4606f887d5c', '202.93.220.32', '0', '1262244214', '0') then try to identify how it got inserted to slave server.
Thanks mwasif. I have tried on the second option SET GLOBAL SQL_SLAVE_SKIP_COUNTER =1; but still getting SLAVE_SQL_RUNNING : No . I only do it once since i'm getting some feedback from other forum that it isn't the best solution to fix it. If i delete as suggested in option 1, i'm worried for the values it holding .