summaryrefslogtreecommitdiff
path: root/debian/additions/mysqlreport.1
blob: 29435193ec1e2dbe5e0e61a5025a8297fdd8146c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
.TH "mysqlreport" "1" "2.5 2006-09-01 (docrev 2006-05-19)" "Daniel Nichter" "MYSQL"
.SH "NAME"
.LP 
mysqlreport \- Makes a friendly report of important MySQL status values
.SH "SYNTAX"
.LP 
mysqlreport [\fIoptions\fP]
.SH "DESCRIPTION"
.LP 
mysqlreport makes a friendly report of important MySQL status values. Actually,
it makes a friendly report of nearly every status value from SHOW STATUS.
Unlike SHOW STATUS which simply dumps over 100 values to screen in one long
list, mysqlreport interprets and formats the values and presents the basic
values and many more inferred values in a human\-readable format. Numerous
example reports are available at the mysqlreport web page at
http://hackmysql.com/mysqlreport.

The benefit of mysqlreport is that it allows you to very quickly see a wide
array of performance indicators for your MySQL server which would otherwise
need to be calculated by hand from all the various SHOW STATUS values. For
example, the Index Read Ratio is an important value but it's not present in
SHOW STATUS; it's an inferred value (the ratio of Key_reads to
Key_read_requests).

This documentation outlines all the command line options in mysqlreport, most
of which control which reports are printed. This document does not address
how to interpret these reports; that topic is covered in the document Guide
To Understanding mysqlreport at http://hackmysql.com/mysqlreportguide.

.SH "OPTIONS"
Technically, command line options are in the form \-\-option, but \-option works
too. All options can be abbreviated if the abbreviation is unique. For example,
option \-\-host can be abbreviated \-\-ho but not \-\-h because \-\-h is ambiguous: it
could mean \-\-host or \-\-help.

.LP 

.TP 
\fB\-\-help\fR
Output help information and exit.

.TP 
\fB\-\-user USER\fR

.TP 
\fB\-\-password\fR
As of version 2.3 \-\-password can take the password on the
command line like "\-\-password FOO". Using \-\-password
alone without giving a password on the command line
causes mysqlreport to prompt for a password.

.TP 
\fB\-\-host ADDRESS\fR

.TP 
\fB\-\-port PORT\fR

.TP
\fB\-\-socket SOCKET\fR

.TP 
\fB\-\-no\-mycnf\fR
\-\-no\-mycnf makes mysqlreport not read ~/.my.cnf which it does by default
otherwise. \-\-user and \-\-password always override values from ~/.my.cnf.

.TP 
\fB\-\-dtq\fR
Print Distribution of Total Queries (DTQ) report (under
Total in Questions report). Queries (or Questions) can
be divided into four main areas: DMS (see \-\-dms below),
Com_ (see \-\-com below), COM_QUIT (see COM_QUIT and
Questions at http://hackmysql.com/com_quit), and
Unknown. \-\-dtq lists the number of queries in each of
these areas in descending order.

.TP 
\fB\-\-dms\fR
Print Data Manipulation Statements (DMS) report (under
DMS in Questions report). DMS are those from the MySQL
manual section 13.2. Data Manipulation Statements.
(Currently, mysqlreport considers only SELECT, INSERT,
REPLACE, UPDATE, and DELETE.) Each DMS is listed in
descending order by count.

.TP 
\fB\-\-com N\fR
Print top N number of non\-DMS Com_ status values in
descending order (after DMS in Questions report). If N
is not given, default is 3. Such non\-DMS Com_ values
include Com_change_db, Com_show_tables, Com_rollback,
etc.

.TP 
\fB\-\-sas\fR
Print report for Select_ and Sort_ status values (after
Questions report). See MySQL Select and Sort Status
Variables at http://hackmysql.com/selectandsort.

.TP
\fB\-\-tab\fR
Print Threads, Aborted, and Bytes status reports (after
Created temp report). As of mysqlreport v2.3 the
Threads report reports on all Threads_ status values.

.TP
\fB\-\-qcache\fR
Print Query Cache report.
.TP
\fB\-\-all\fR
Equivalent to "\-\-dtq \-\-dms \-\-com 3 \-\-sas \-\-qcache".
(Notice \-\-tab is not invoked by \-\-all.)

.TP
\fB\-\-infile FILE\fR
Instead of getting SHOW STATUS values from MySQL, read
values from FILE. FILE is often a copy of the output of
SHOW STATUS including formatting characters (|, +, \-).
mysqlreport expects FILE to have the format
" value number " where value is only alpha and
underscore characters (A\-Z and _) and number is a
positive integer. Anything before, between, or after
value and number is ignored. mysqlreport also needs
the following MySQL server variables: version,
table_cache, max_connections, key_buffer_size,
query_cache_size. These values can be specified in
INFILE in the format "name = value" where name is one
of the aforementioned server variables and value is a
positive integer with or without a trailing M and
possible periods (for version). For example, to specify
an 18M key_buffer_size: key_buffer_size = 18M. Or, a
256 table_cache: table_cache = 256. The M implies
Megabytes not million, so 18M means 18,874,368 not
18,000,000. If these server variables are not specified
the following defaults are used (respectively) which
may cause strange values to be reported: 0.0.0, 64,
100, 8M, 0.

.TP
\fB\-\-outfile FILE\fR  
After printing the report to screen, print the report
to FILE too. Internally, mysqlreport always writes the
report to a temp file first: /tmp/mysqlreport.PID on
*nix, c:\mysqlreport.PID on Windows (PID is the
script's process ID). Then it prints the temp file to
screen. Then if \-\-outfile is specified, the temp file
is copied to OUTFILE. After \-\-email (below), the temp
file is deleted.

.TP
\fB\-\-email ADDRESS\fR
After printing the report to screen, email the report
to ADDRESS. This option requires sendmail in
/usr/sbin/, therefore it does not work on Windows.
/usr/sbin/sendmail can be a sym link to qmail, for
example, or any MTA that emulates sendmail's \-t
command line option and operation. The FROM: field is
"mysqlreport", SUBJECT: is "MySQL status report".

.TP
\fB\-\-flush\-status\fR
Execute a "FLUSH STATUS;" after generating the reports.
If you do not have permissions in MySQL to do this an
error from DBD::MariaDB::st will be printed after the
reports.

.SH "AUTHORS"
.LP 
Daniel Nichter

If mysqlreport breaks, send me a message from 
http://hackmysql.com/feedback 
with the error.

.SH "SEE ALSO"
.LP 
mytop(1)
.LP
The comprehensive Guide To Understanding mysqlreport at 
http://hackmysql.com/mysqlreportguide.