mysql_test

------------------

#/bin/sh


binlogfile=$1


if [ ! -n $binlogfile ]
then
echo "pls input your mysqlbinlogfile name."
else
/usr/local/mysql/bin/mysqlbinlog --no-defaults --base64-output=decode-row -v -v ${binlogfile}
| awk '/###/{if($0~/UPDATE|INSERT|DELETE/) count[$2" " $NF]++} END{for(i in count) print i," ",count[i]}'
| column -t | sort -k3nr

fi

原文地址:https://www.cnblogs.com/moss_tan_jun/p/8596743.html