正文
Multiple
ports should be splited
by
','
.
eg
.
3306
,
3307
this
option has
no
effect
when
-
f
is
set
.
-
r port range
,
Don
't use -r and -p at the same time
-l query log DIRECTORY. Make sure that the directory is accessible. Default to stdout.
-e error log FILENAME or '
stderr
'. if set to /dev/null, runtime error will not be recorded
-f filename. use pcap file instead capturing the network interface
-w white list. dont capture the port. Multiple ports should be splited by '
,
'.
-t truncation length. truncate long query if it'
s longer than specified length
.
Less
than
0
means
no
truncation
-
n keeping tcp stream count
,
if
not
set
,
default
is
65536.
if
active tcp count
is
larger than the specified count
,
mysql
-
sniffer will remove the oldest one
示例
1. 实时抓取某端口信息并打印到屏幕
输出格式为:时间,访问用户,来源 IP,访问 Database,命令耗时,返回数据行数,执行语句。
mysql-sniffer -i eth0 -p 3306
2017-02-23 14:47:45 testuser 10.xx