Slave_SQL_Running: No

Discussion in 'MySQL' started by hatifahanna, Mar 6, 2011.

  1. #1
    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
     
    hatifahanna, Mar 6, 2011 IP
  2. mwasif

    mwasif Active Member

    Messages:
    816
    Likes Received:
    23
    Best Answers:
    1
    Trophy Points:
    70
    #2
    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.
     
    mwasif, Mar 7, 2011 IP
  3. hatifahanna

    hatifahanna Peon

    Messages:
    671
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #3
    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 .
     
    hatifahanna, Mar 7, 2011 IP
  4. mwasif

    mwasif Active Member

    Messages:
    816
    Likes Received:
    23
    Best Answers:
    1
    Trophy Points:
    70
    #4
    What record do you have on master?
     
    mwasif, Mar 7, 2011 IP
  5. hatifahanna

    hatifahanna Peon

    Messages:
    671
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #5
    i have website contents in the master. it is a db server. it has huge data.
     
    hatifahanna, Mar 8, 2011 IP