Emergency

replace command in binary log not working

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • replace command in binary log not working

    I have binary log edit INSERT to REPLACE to overwrite the data in table but it showing Duplicate key error

    Code:
    [root@etim upload_new]# mysql --defaults-extra-file=/usr/bin/.config145 < BHKR_mysql-bin.002873_13-11-17_2030_1.sql
    ERROR 1062 (23000) at line 32: Duplicate entry '6354429' for key 'PRIMARY'
    Binary log output as below

    SET INSERT_ID=6354429/*!*/;
    #171113 19:32:33 server id 10 end_log_pos 5363984 CRC32 0x349ae0c3 Query thread_id=882 exec_time=0 error_code=0
    SET TIMESTAMP=1510581753/*!*/;
    replace into temp_ticket(waybill_no,etim_no,trip_no,route_no,bu s_service,ticket_code,ticket_number,boarding_stage ,boarding_stage_code,from_stage_code,alright_stage ,alright_stage_code,till_stage_code,full_ticket,ha lf_ticket,luggage_qty,pass_qty,total_amt,ticket_da te,ticket_date_actual,ticket_time, pass_id,insp_conc_code,interstate_code,full_tkt_am t,half_tkt_amt,lugg_tkt_amt,lastupdate,lastupdate_ id,status,bus_capacity,ttl_stages,seq_no,is_ex_tkt ,uid_no,group_ticket_flag,secret_code,maharashtra_ adult_amount,maharashtra_child_amount,state_1_adul t_amount,state_1_child_amount,state_2_adult_amount ,state_2_child_amount,state_3_adult_amount,state_3 _child_amount,state_4_adult_amount,state_4_child_a mount,state_5_adult_amount,state_5_child_amount,ac tual_adult_fare_from_db,actual_child_fare_from_db, actual_lugg_fare_from_db,original_maharashtra_adul t_amount,original_maharashtra_child_amount,origina l_state_1_adult_amount,original_state_1_child_amou nt,original_state_2_adult_amount,original_state_2_ child_amount,original_state_3_adult_amount,origina l_state_3_child_amount,original_state_4_adult_amou nt,original_state_4_child_amount,original_state_5_ adult_amount,original_state_5_child_amount,per_adu lt_original_fare,per_child_original_fare,per_lugg_ original_fare,reservation_charge,gprs_status,seat_ no,epurse_ticket,refund_ticket_id,version_type,div isionname,divisioncode,deponame,depocode,ASN_amoun t,per_adult_service_tax_amount,per_child_service_t ax_amount,service_charge)values('109333','BHKR5002 ','000L1385','61109','3','00','023849','001','OO', 'BHKR','009','O-','NND','02','01','00','00','0014300','12/11/17','2017-11-12','17:12:42','','00','0','0011400','0002900','0' ,'','','','44','9','','0','','0','0','11400','2900 ','0','0','0','0','0','0','0','0','0','0','5670',' 2850','270','11400','2900','0','0','0','0','0','0' ,'0','0','0','0','5700','2900','300','0','1','','0 ','0','MOFF','','','','','300','0','0','0'),('1093 33','BHKR5002','000L1385','61109','3','00','023850 ','001','OO','BHKR','004','O-','SEBLAN','01','00','00','00','0002200','12/11/17','2017-11-12','17:13:05','','00','0','0002200','0000000','0' ,'','','','44','3.5','','0','','0','0','2200','0', '0','0','0','0','0','0','0','0','0','0','2205','11 00','120','2200','0','0','0','0','0','0','0','0',' 0','0','0','2200','0','100','



    ====
    Create Table: CREATE TABLE `temp_ticket` (
    `ticket_id` int(11) NOT NULL AUTO_INCREMENT,
    `waybill_no` int(100) NOT NULL,
    `etim_no` varchar(100) NOT NULL,
    `trip_no` varchar(10) NOT NULL,
    `route_no` int(100) NOT NULL,

    `service_charge` int(20) NOT NULL,
    PRIMARY KEY (`ticket_id`),
    KEY `waybill_no` (`waybill_no`) USING BTREE
    ) ENGINE=MyISAM AUTO_INCREMENT=6595631 DEFAULT CHARSET=latin1
    1 row in set (0.00 sec)
Working...
X