1. 程式人生 > >mysqlbinlog日誌delete轉成insert指令碼

mysqlbinlog日誌delete轉成insert指令碼

cat hf.txt | sed -n '/###/p' | sed 's/### //g;s/\/\*.*/,/g;s/DELETE FROM/INSERT INTO/g;s/WHERE/SELECT/g;' |sed -r 's/(@17.*),/\1;/g' | sed 's/@[1-9]=//g' | sed 's/@[1-1][0-7]=//g'