{
    "mode": "man",
    "parameter": "mysqldumpslow",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/mysqldumpslow/1/json",
    "generated": "2026-07-05T13:27:29Z",
    "synopsis": "mysqldumpslow [options] [logfile ...]",
    "sections": {
        "NAME": {
            "content": "mysqldumpslow - Summarize slow query log files\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "mysqldumpslow [options] [logfile ...]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "The MySQL slow query log contains information about queries that take a long time to execute\n(see Section 7.4.5, “The Slow Query Log”).  mysqldumpslow parses MySQL slow query log files\nand summarizes their contents.\n\nNormally, mysqldumpslow groups queries that are similar except for the particular values of\nnumber and string data values. It “abstracts” these values to N and 'S' when displaying\nsummary output. To modify value abstracting behavior, use the -a and -n options.\n\nInvoke mysqldumpslow like this:\n\nmysqldumpslow [options] [logfile ...]\n\nExample output with no options given:\n\nReading mysql slow query log from /usr/local/mysql/data/mysqld80-slow.log\nCount: 1  Time=4.32s (4s)  Lock=0.00s (0s)  Rows=0.0 (0), root[root]@localhost\ninsert into t2 select * from t1\nCount: 3  Time=2.53s (7s)  Lock=0.00s (0s)  Rows=0.0 (0), root[root]@localhost\ninsert into t2 select * from t1 limit N\nCount: 3  Time=2.13s (6s)  Lock=0.00s (0s)  Rows=0.0 (0), root[root]@localhost\ninsert into t1 select * from t1\n\nmysqldumpslow supports the following options.\n\n•   --help\n\n┌────────────────────┬────────┐\n│Command-Line Format │ --help │\n└────────────────────┴────────┘\nDisplay a help message and exit.\n\n•   -a\n\nDo not abstract all numbers to N and strings to 'S'.\n\n•   --debug, -d\n\n┌────────────────────┬─────────┐\n│Command-Line Format │ --debug │\n└────────────────────┴─────────┘\nRun in debug mode.\n\nThis option is available only if MySQL was built using WITHDEBUG. MySQL release binaries\nprovided by Oracle are not built using this option.\n\n•   -g pattern\n\n┌─────┬────────┐\n│Type │ String │\n└─────┴────────┘\nConsider only queries that match the (grep-style) pattern.\n\n•   -h hostname\n\n┌──────────────┬────────┐\n│Type          │ String │\n├──────────────┼────────┤\n│Default Value │ *      │\n└──────────────┴────────┘\nHost name of MySQL server for *-slow.log file name. The value can contain a wildcard. The\ndefault is * (match all).\n\n•   -i name\n\n┌─────┬────────┐\n│Type │ String │\n└─────┴────────┘\nName of server instance (if using mysql.server startup script).\n\n•   -l Do not subtract lock time from total time.\n\n•   -n N\n\n┌─────┬─────────┐\n│Type │ Numeric │\n└─────┴─────────┘\nAbstract numbers with at least N digits within names.\n\n•   -r Reverse the sort order.\n\n•   -s sorttype\n\n┌──────────────┬────────┐\n│Type          │ String │\n├──────────────┼────────┤\n│Default Value │ at     │\n└──────────────┴────────┘\nHow to sort the output. The value of sorttype should be chosen from the following list:\n\n•   t, at: Sort by query time or average query time\n\n•   l, al: Sort by lock time or average lock time\n\n•   r, ar: Sort by rows sent or average rows sent\n\n•   c: Sort by count\n\nBy default, mysqldumpslow sorts by average query time (equivalent to -s at).\n\n•   -t N\n\n┌─────┬─────────┐\n│Type │ Numeric │\n└─────┴─────────┘\nDisplay only the first N queries in the output.\n\n•   --verbose, -v\n\n┌────────────────────┬───────────┐\n│Command-Line Format │ --verbose │\n└────────────────────┴───────────┘\nVerbose mode. Print more information about what the program does.\n",
            "subsections": []
        },
        "COPYRIGHT": {
            "content": "Copyright © 1997, 2024, Oracle and/or its affiliates.\n\nThis documentation is free software; you can redistribute it and/or modify it only under the\nterms of the GNU General Public License as published by the Free Software Foundation; version\n2 of the License.\n\nThis documentation is distributed in the hope that it will be useful, but WITHOUT ANY\nWARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR\nPURPOSE. See the GNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License along with the program; if\nnot, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\n02110-1301 USA or see http://www.gnu.org/licenses/.\n\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "For more information, please refer to the MySQL Reference Manual, which may already be\ninstalled locally and which is also available online at http://dev.mysql.com/doc/.\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Oracle Corporation (http://dev.mysql.com/).\n\n\n\nMySQL 8.0                                    12/13/2024                             MYSQLDUMPSLOW(1)",
            "subsections": []
        }
    },
    "summary": "mysqldumpslow - Summarize slow query log files",
    "flags": [],
    "examples": [],
    "see_also": []
}