# man mysqlsla XXX XXX WARNING: old character encoding and/or character set XXX mysqlsla(3) User Contributed Perl Documentation mysqlsla(3) NAME mysqlsla – Parse, filter, analyze and sort MySQL slow, general and binary logs SYNOPSIS # Basic operation: parse a MySQL slow or general log mysqlsla –log-type slow LOG mysqlsla –log-type general LOG # Parse output from mysqlbinlog # mysqlsla cannot directly parse binary logs mysqlbinlog LOG │ mysqlsla –log-type binary - # Parse a microslow patched slow log mysqlsla –log-type msl LOG # Replay a replay file mysqlsla –replay FILE # Parse a user-defined log specify its format mysqlsla –log-type udl –udl-format FILE # Let mysqlsla automatically determine the log type mysqlsla LOG DESCRIPTION mysqlsla parses, filters, analyzes and sorts MySQL slow, general, binary and microslow patched slow logs. It also supports user-defined logs. This POD/man page is only a very brief outline of usage and command line options. For the full library of mysqlsla documentation visithttp://hackmysql.com/mysqlsla. # mysqlsla /tmp/mysqlslow.log | less Auto-detected logs as slow logs Report for slow logs: /tmp/mysqlslow.log 6 queries total, 6 unique Sorted by ‘t_sum’ Grand Totals: Time 0 s, Lock 0 s, Rows sent 13, Rows Examined 13 ______________________________________________________________________ 001 ___ Count : 1 (16.67%) Time : 2.321 ms total, 2.321 ms avg, 2.321 ms to 2.321 ms max (47.20%) Lock Time (s) : 629 ?s total, 629 ?s avg, 629 ?s to 629 ?s max (77.75%) Rows sent : 8 avg, 8 to 8 max (61.54%) Rows examined : 8 avg, 8 to 8 max (61.54%) Database : Users : root@ 192.168.1.100 : 100.00% (1) of query, 100.00% (6) of all users Query abstract: SET timestamp=N; SHOW variables LIKE ‘S’; Query sample: SET timestamp=1252395365; show variables like ‘%character%’; …… 格式说明如下: