The MySQL server and most MySQL clients are compiled with the DBUG
package originally created by Fred Fish. When you have configured
MySQL for debugging, this package makes it possible to get a trace
file of what the program is debugging. See
Section E.1.2, “Creating Trace Files”.
This section summaries the argument values that you can specify in
debug options on the command line for MySQL programs that have
been built with debugging support. For more information about
programming with the DBUG package, see the DBUG manual in the
dbug
directory of MySQL source distributions.
It's best to use a recent distribution for MySQL 5.1
to get the most updated DBUG manual.
You use the debug package by invoking a program with the
--debug="..."
or the -#...
option.
Most MySQL programs have a default debug string that is used if
you don't specify an option to --debug
. The
default trace file is usually
/tmp/program_name.trace
on Unix and
\program_name.trace
on Windows.
The debug control string is a sequence of colon-separated fields
as follows:
<field_1>:<field_2>:...:<field_N>
Each field consists of a mandatory flag character followed by an
optional ‘,
’ and comma-separated
list of modifiers:
flag[,modifier,modifier,...,modifier]
The currently recognized flag characters are:
Some examples of debug control strings that might appear on a
shell command line (the -#
is typically used to
introduce a control string to an application program) are:
-#d:t
-#d:f,main,subr1:F:L:t,20
-#d,input,output,files:n
-#d:t:i:O,\\mysqld.trace
In MySQL, common tags to print (with the d
option) are enter
, exit
,
error
, warning
,
info
, and loop
.