mysqlreport(1)
π mysqlreport β the manual page, but make it slay
okay bestie, welcome to mysqlreport(1) from the MYSQL section of your friendly neighbourhood man pages π this is the part where I tell you what this little script does and you go "oh word?" and then we both go get a snack.
β¨ NAME β¨
mysqlreport β makes a friendly report of important MySQL status values π
πΈ SYNTAX πΈ
mysqlreport [options]
π¦ DESCRIPTION π¦
so. mysqlreport makes a friendly report of important MySQL status values. and when I say friendly I mean it. it actually makes a friendly report of nearly every status value from SHOW STATUS. like, the whole thing. no cap.
here's the tea: SHOW STATUS just dumps over 100 values onto your screen in one long list and leaves you there, blinking, like π. mysqlreport does not do that to you. it interprets and formats the values, and presents the basic values plus many more inferred values in a human-readable format. literally iconic. there are numerous example reports available at the mysqlreport web page at http://hackmysql.com/mysqlreport π«Ά
the whole benefit of mysqlreport is that it lets you very quickly see a wide array of performance indicators for your MySQL server that would otherwise need to be calculated by hand from all the various SHOW STATUS values. for example (and this is such a good example), the Index Read Ratio is an important value but it's not present in SHOW STATUS β it's an inferred value, aka the ratio of Key_reads to Key_read_requests. see? slay. β¨
this documentation outlines all the command line options in mysqlreport, most of which control which reports are printed. it does not address how to interpret these reports β that topic is covered in the document Guide To Understanding mysqlreport at http://hackmysql.com/mysqlreportguide. iykyk π
π OPTIONS π
technically, command line options are in the form --option, but -option works too. all options can be abbreviated if the abbreviation is unique. for example, option --host can be abbreviated --ho but not --h because --h is ambiguous: it could mean --host or --help. rude of it, honestly. π
--helpβ output help information and exit. the classic.--user USERβ your user, bestie.--passwordβ as of version 2.3--passwordcan take the password on the command line like"--password FOO". using--passwordalone without giving a password on the command line causesmysqlreportto prompt for a password. mysterious. π--host ADDRESSβ the host address.--port PORTβ the port.--socket SOCKETβ the socket.--no-mycnfβ--no-mycnfmakesmysqlreportnot read~/.my.cnfwhich it does by default otherwise.--userand--passwordalways override values from~/.my.cnf. always. periodt.--dtqβ print the Distribution of Total Queries (DTQ) report (under Total in the Questions report). queries (or Questions) can be divided into four main areas: DMS (see--dmsbelow),Com_(see--combelow),COM_QUIT(see COM_QUIT and Questions at http://hackmysql.com/com_quit), and Unknown.--dtqlists the number of queries in each of these areas in descending order. β¨--dmsβ print the Data Manipulation Statements (DMS) report (under DMS in the Questions report). DMS are those from the MySQL manual section 13.2. Data Manipulation Statements. (currently,mysqlreportconsiders onlySELECT,INSERT,REPLACE,UPDATE, andDELETE.) each DMS is listed in descending order by count.--com Nβ print top N number of non-DMSCom_status values in descending order (after DMS in the Questions report). if N is not given, the default is3. such non-DMSCom_values includeCom_change_db,Com_show_tables,Com_rollback, etc. etc. etc.--sasβ print the report forSelect_andSort_status values (after the Questions report). see MySQL Select and Sort Status Variables at http://hackmysql.com/selectandsort π¦--tabβ print Threads, Aborted, and Bytes status reports (after the Created temp report). as ofmysqlreportv2.3 the Threads report reports on allThreads_status values. all of them. obsessed.--qcacheβ print the Query Cache report. π§--allβ equivalent to"--dtq --dms --com 3 --sas --qcache". (notice--tabis not invoked by--all. just so we're clear, bestie. π)--infile FILEβ instead of gettingSHOW STATUSvalues from MySQL, read values from FILE. FILE is often a copy of the output ofSHOW STATUSincluding formatting characters (|,+,-).mysqlreportexpects FILE to have the format" value number "where value is only alpha and underscore characters (A-Zand_) and number is a positive integer. anything before, between, or after value and number is ignored.mysqlreportalso needs the following MySQL server variables:version,table_cache,max_connections,key_buffer_size,query_cache_size. these values can be specified in INFILE in the format"name = value"where name is one of the aforementioned server variables and value is a positive integer with or without a trailingMand possible periods (for version). for example, to specify an18Mkey_buffer_size:key_buffer_size = 18M. or, a256table_cache:table_cache = 256. theMimplies Megabytes not million, so18Mmeans18,874,368not18,000,000. do not come for me about it, that's just the math. π€ if these server variables are not specified the following defaults are used (respectively) which may cause strange values to be reported:0.0.0,64,100,8M,0.--outfile FILEβ after printing the report to screen, print the report to FILE too. internally,mysqlreportalways writes the report to a temp file first:/tmp/mysqlreport.PIDon *nix,c:sqlreport.PIDon Windows (PID is the script's process ID). then it prints the temp file to screen. then if--outfileis specified, the temp file is copied to OUTFILE. after--email(below), the temp file is deleted. bye bye temp file π«‘--email ADDRESSβ after printing the report to screen, email the report to ADDRESS. this option requiressendmailin/usr/sbin/, therefore it does not work on Windows./usr/sbin/sendmailcan be a sym link to qmail, for example, or any MTA that emulates sendmail's-tcommand line option and operation. theFROM:field is"mysqlreport",SUBJECT:is"MySQL status report". π--flush-statusβ execute a"FLUSH STATUS;"after generating the reports. if you do not have permissions in MySQL to do this an error fromDBD::MariaDB::stwill be printed after the reports. > bestie if you don't have the perms, the error is coming for you and it will be printed after the reports. you've been warned π
π AUTHORS π
Daniel Nichter π
if mysqlreport breaks, send me a message from http://hackmysql.com/feedback with the error. fr fr, tell me everything.
π SEE ALSO π
mytop(1) π
the comprehensive Guide To Understanding mysqlreport at http://hackmysql.com/mysqlreportguide.
and that's the whole page, bestie β¨ this was written by Daniel Nichter, version 2.5, dated 2006-09-01 (docrev 2006-05-19) β so like, vintage, but in a main character way. go read your status values. go be free. ππ¦
π¦ where this page comes from
- debian bookworm: mariadb-client 1:10.11.18-0+deb12u1 Β· GPL-2.0-only
- debian bookworm: mariadb-client 1:10.11.19-0+deb12u1 Β· GPL-2.0-only
- debian trixie: mariadb-client 1:11.8.6-0+deb13u1 Β· GPL-2.0-only
- ubuntu jammy: mariadb-client-10.6 1:10.6.22-0ubuntu0.22.04.1 Β· GPL-2.0-only
- ubuntu jammy: mariadb-client-10.6 1:10.6.23-0ubuntu0.22.04.1 Β· GPL-2.0-only
- ubuntu jammy: mariadb-client-10.6 1:10.6.7-2ubuntu1 Β· GPL-2.0-only
- ubuntu noble: mariadb-client 1:10.11.13-0ubuntu0.24.04.1 Β· GPL-2.0-only
- ubuntu noble: mariadb-client 1:10.11.14-0ubuntu0.24.04.1 Β· GPL-2.0-only
- ubuntu noble: mariadb-client 1:10.11.7-2ubuntu2 Β· GPL-2.0-only
- ubuntu questing: mariadb-client 1:11.8.3-1build1
- ubuntu resolute: mariadb-client 1:11.8.6-5 Β· GPL-2.0-only
- ubuntu resolute: mariadb-client 1:11.8.6-5ubuntu0.1 Β· GPL-2.0-only
- ubuntu stonking: mariadb-client 1:11.8.9+ds-4ubuntu2 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms