Name

mysqldumpslow

Synopsis

mysqldumpslow [options] [filename]

Use this utility to display a summary of the slow query log. The name of the log file may be given in the second argument. Otherwise, the utility will look to the server’s configuration file (i.e., my.cnf or my.ini, depending on your system) for this information. The following options can narrow the summary or change what is displayed.

mysqldumpslow options

-a

This option instructs the utility not to combine queries with similar SQL statements.

--debug, -d

This option enables debugging mode.

-g expression

This option extracts information on queries that meet the given expression.

-h host

This option specifies the host’s name for which the utility is to scan. By default, log files are named with the server’s hostname as the filename’s prefix.

--help

This option displays help information on the utility.

-i host

This option specifies the hostname of the server.

-l

With this option, the lock time is added to the execution time for the utility’s summary.

-n number

This option sets the minimum number of occurrences for reporting.

-r

This option reverses the order of sorts for reporting.

-s type

This option specifies the type of queries on which to report. The choices are al for average lock time, ar for average rows, at for average execution time, l for lock time, r for rows, and t for execution time.

-t

This option sets the number of queries on which to display.

--verbose, -v

This option displays more information.

Get MySQL in a Nutshell, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.