This is a read-only copy of the MariaDB Knowledgebase generated on 2024-11-14. For the latest, interactive version please visit https://mariadb.com/kb/.

mariadb-report

mariadb-report makes a friendly report of important MariaDB status values.

Prior to MariaDB 10.5, the client was called mysqlreport. It can still be accessed under this name, via a symlink in Linux, or an alternate binary in Windows.

Actually, mariadb-report makes a friendly report of nearly every status value from SHOW STATUS. Unlike SHOW STATUS which simply dumps over 100 values to the screen in one long list, mariadb-report interprets and formats the values and presents the basic values and many more inferred values in a human-readable format. Numerous example reports are available in the archive of the old hackmysql.com/mysqlreport, archived here.

The benefit of mariadb-report is that it allows you to very quickly see a wide array of performance indicators for your MariaDB server which would otherwise need to be calculated by hand from all the various SHOW STATUS values. For example, the Index Read Ratio is an important value but it's not present in SHOW STATUS; it's an inferred value (the ratio of Key_reads to Key_read_requests).

This documentation outlines all the command line options in mariadb-report, most of which control which reports are printed. This document does not address how to interpret these reports; that topic is covered in the document Guide To Understanding mysqlreport, archived here.

Usage

mariadb-report [options]

mariadb-report 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 to --ho but not --h because --h is ambiguous: it could mean --host or --help.

OptionDescription
--allEquivalent to --dtq --dms --com 3 --sas --qcache. (Notice --tab is not invoked by --all.)
--com NPrint top N number of non-DMS Com_ status values in descending order (after DMS in Questions report). If N is not given, default is 3. Such non-DMS Com_ values include Com_change_db, Com_show_tables, Com_rollback, etc.
--dmsPrint Data Manipulation Statements (DMS) report (under DMS in Questions report). DMS are those from the Data Manipulation section. mariadb-report considers only SELECT, INSERT, REPLACE, UPDATE, and DELETE. Each DMS is listed in descending order by count.
--dtqPrint Distribution of Total Queries (DTQ) report (under Total in Questions report). Queries (or Questions) can be divided into four main areas: DMS (see --dms), Com_ (see --com ), COM_QUIT (see COM_QUIT and Questions, archived here), and Unknown. --dtq lists the number of queries in each of these areas in descending order.
--email ADDRESSAfter printing the report to screen, email the report to ADDRESS. This option requires sendmail in /usr/sbin/, therefore it does not work on Windows. /usr/sbin/sendmail can be a sym link to qmail, for example, or any MTA that emulates sendmail's -t command line option and operation. The FROM: field is "mariadb-report", SUBJECT: is "MySQL status report".
--flush-statusExecute a FLUSH STATUS after generating the reports. If you do not have permissions in MariaDB to do this an error from DBD::mysql::st will be printed after the reports.
--helpOutput help information and exit.
--host ADDRESSHost address.
--infile FILEInstead of getting SHOW STATUS values from MariaDB, read values from FILE. FILE is often a copy of the output of SHOW STATUS including formatting characters (+, -). mariadb-report expects FILE to have the format " value number " where value is only alpha and underscore characters (A-Z and _) and number is a positive integer. Anything before, between, or after value and number is ignored. mariadb-report also needs the following MariaDB 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 trailing M and possible periods (for version). For example, to specify an 18M key_buffer_size: key_buffer_size = 18M. Or, a 256 table_cache: table_cache = 256. The M implies Megabytes not million, so 18M means 18,874,368 not 18,000,000. 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.
--no-mycnfMakes mariadb-report not read /.my.cnf which it does by default otherwise. --user and --password always override values from /.my.cnf.
--outfile FILEAfter printing the report to screen, print the report to FILE too. Internally, mariadb-report always writes the report to a temp file first: /tmp/mysqlreport.PID on *nix, c:sqlreport.PID on Windows (PID is the script's process ID). Then it prints the temp file to screen. Then if --outfile is specified, the temp file is copied to OUTFILE. After --email (above), the temp file is deleted.
--passwordAs of version 2.3 --password can take the password on the command line like --password FOO. Using --password alone without giving a password on the command line causes mariadb-report to prompt for a password.
--port PORTPort number.
--qcachePrint Query Cache report.
--sasPrint report for Select_ and Sort_ status values (after Questions report). See MySQL Select and Sort Status Variables, archived here.
--socket SOCKETFor connections to localhost, the Unix socket file to use, or, on Windows, the name of the named pipe to use.
--tabPrint Threads, Aborted, and Bytes status reports (after Created temp report). The Threads report reports on all Threads_ status values.
--user USERNAMEUsername.
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.