The built-in MySQL Shell report
available from MySQL Shell 8.0.18. It provides detailed
information about a specific thread in the connected MySQL
server. The report works with servers running all supported
MySQL 5.7 and MySQL 8.0 versions. If any item of information is
not available in the MySQL Server version of the target server,
the report leaves it out.
thread report provides information for
the selected thread and its activity, drawn from various sources
including MySQL's Performance Schema. By default, the report
shows information on the thread used by the current connection,
or you can identify a thread by its ID or by the connection ID.
You can select one or more categories of information, or view
all of the available information about the thread. For details
of the report-specific options and the information that you can
include in the report, issue one of the following MySQL Shell
commands to view the report help:
\help thread \show thread --help
In addition to the report-specific options, the
thread report accepts most of the standard
options for the
\watch commands, as described in
Section 6.1.5, “Running MySQL Shell Reports”. The exception is
option for the
\show command, which is not
thread report has a custom
output format that includes vertical listings and tables
presented in different sections, and you cannot change this
threads report uses MySQL Server's
format_statement() function (see
The format_statement() Function). Any truncated
statements displayed in the report are truncated according to
the setting for the
option in MySQL Server's
sys_config table, which defaults
to 64 characters.
The following list summarizes the capabilities provided by the
report-specific options for the
report. See the report help for full details and the short forms
of the options:
Identify the thread ID or connection ID on which you want to report.
Show basic information about the thread. This information is returned by default if you do not use any of the following options.
Show a brief description of the thread on one line.
Show information about the client connection and client session.
Show information about the current InnoDB transaction using the thread, if any.
Show information about locks blocking and blocked by the thread.
Show information about the prepared statements allocated for the thread.
Show information about the session status variables for the thread. You can specify a list of prefixes to match, in which case only matching variables are displayed.
Show information about the session system variables for the thread. You can specify a list of prefixes to match, in which case only matching variables are displayed.
Show information about the user-defined variables for the thread. You can specify a list of prefixes to match, in which case only matching variables are displayed.
Show all of the above information, except for the brief description.
For example, the following command runs the
thread report for the thread with thread ID
53, and returns general information about the thread, details of
the client connection, and information about any locks that the
thread is blocking or is blocked by:
mysql-py> \show thread --tid 53 --general --client --locks