Use mysqldumpslow of MySQL for slow log analysis in Windows

Source: Internet
Author: User

1. Install the Perl environment first.
2. Switch to the perl directory in the DOS environment. For example, my directory is
DOS command cd c: \ Perl \ bin
3. Enter the Perl mysqldumpslow path \ mysqldumpslow. pl + mysqldumpslow command + slow. Log Path + output location in this directory.
For example, the mysqldumpslow directory is
The slow. log directory is c: \ Perl \ bin \ slow. log.
The output file is time. txt, And the directory is E :\

The command parameters of mysqldumpslow are listed as follows:

-- Help: Output help information

-V: Output details
-D debugging
-S is sorted in descending order. The default value is 'at '.
AL: average lock table time

AR: Average number of result rows
At: Average query time
C: Times
L: Lock table time
R: Number of Summary Results
T: total query time
-R: sort in ascending order, that is, sort in ascending order.

-T num: Limit the number of entries displayed

-A shows numbers and strings. The default number is "N" and the string is "S'
-G pattern: filter the string, followed by a regular expression, such as the condition that '10 $ 'ends with 10

Example:

/Usr/local/MySQL/bin/mysqldumpslow-s t-a-t 3 slots txt

Sort by the total query time. Only the first three items are listed.

/Usr/local/MySQL/bin/mysqldumpslow-r-s c-a-t 3-g'hello' slow.txt

Search for results that contain the keyword "hello" and sort the first three results in the ascending order of the number of times.


This is original, reprint this log please indicate the source http://blog.163.com/zenglonglong525@126/

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.