分类: Mysql/postgreSQL
2009-09-23 13:02:25
Shell> for x in var=`cat mysql.log |grep Connect |awk '{print $2}' |cut -d: -f3`; do echo ${var:2:50} >> out.txt; done |
Shell> for x in `cat ./out.txt`; do cat mysql.log | awk -v x="$x" '{ if ( $1 == x ) { printf("%s ;\n",$0,x) } }' $1; done |awk -FQuery '{print $2 “ ;”}' |grep –v “INSERT” >> myqueries.txt |