Mysqlreport Chinese document _ MySQL

Source: Internet
Author: User
Mysqlreport Chinese document mysqlreport displays MySQL status changes in a friendly way. In fact, it reports almost all states. Unlike show status, which only displays more than 100 STATUS values, mysqlreport interprets and formats these STATUS values in a user-friendly manner, greatly increasing their readability. Click here to view the example of mysqlreport.
The advantage of mysqlreport is that you can quickly view various STATUS parameter groups to understand the running STATUS of the server without manual computation from the results of show status. For example, the index read rate is an important parameter, but it is not displayed in show status; it is an inferred value (the ratio of key_reads to key_read_requests ).


This document describes all command line options of mysqlreport, most of which are used to control how results are displayed. This article does not explain how the inferred values are calculated. you can click "understanding" mysqlreport to view the specific calculation method.

Note:
The format of the command line option is -- option, but the format of-option is also acceptable. All options have their abbreviations, as long as they are unique. For example, the option -- host can be abbreviated to -- ho, but cannot be written as -- h, because -- h is ambiguous and may be -- host or -- help.
Option list
-- User USER
-- Password
-- Host ADDRESS
-- Port PORT
-- Socket SOCKET
-- No-mycnf
-- Help these options simulate other standard applications. From version 2.3, -- password can be followed by a parameter, for example, "-- password FOO ". If only the option -- password is specified in the command line, the system prompts you to enter the password. -- No-mycnf tells mysqlreport not to read ~ /. My. cnf, which reads the file by default. -- User and -- password are always overwritten from ~ /. My. cnf.
-- Infile FILE: Read the status file directly from the FILE, rather than from the MySQL show status file. The file content is usually obtained from the show status result and contains formatted characters (|, + ,-). Mysqlreport considers this file "status name value" format, the status contains characters and underscores (A-Z and _), the value is a non-negative integer. Any content between the status name and value is ignored. Mysqlreport also requires the following MySQL server system variables: version, table_cache, max_connections, key_buffer_size, query_cache_size, and thread_cache_size. The INFILE format can also be "name = value". The name can be the names of various variables mentioned above. The value is a non-negative integer, it may be followed by M or other units (depending on the version ). For example, you want to specify the key_buffer_size of 18 M: key_buffer_size = 18 M. Or, 256 table_cache: table_cache = 256. M refers to megabytes, not millions. Therefore, 18 M is 18,874,368, not 18,000,000. If these Server variables are not specified, the following default values are used: 0.0.0, 64,100, 8 M, 0, 0, which may make the report results look strange.
Note: When MySQL server version 5.1.3 or updated, although the system variable table_cache is changed to table_open_cache, table_cache is still used to read local files.

-- Outfile FILE: After the report result is displayed on the screen, write the result to the FILE. The internal mechanism of mysqlreport always writes the results to temporary files first. Print the contents of the temporary file to the screen. If the -- outfile option is specified, the temporary file is copied to the OUTFILE. If the option -- email is specified, the temporary file is deleted.
-- Email ADDRESS: after the result is displayed on the screen, the result is sent to the email ADDRESS. To use this option, you must have a sendmail program in the/usr/sbin/Directory. Therefore, it cannot be used on windows. /Usr/sbin/sendmail can be symbolic links to qmail, or any other MTA program that can simulate sendmail-t. The Mail source is mysqlreport. The subject is MySQL status report on HOST, and the HOST is mysqlreport.
The host name, which may be the read -- host value. The default value is localhost.
-- Flush-status: After the report is displayed, run the "flush status;" statement. If you do not have the permission, DBD: mysql displays the return value.
-- Relative (-r) X mysqlreport generally reports the status information since the MySQL server is started. The -- relative option generates a report for mysqlreport since the previous report.


If the X value of -- relative X is an integer, mysqlreport will generate a status report of the MySQL server again after X seconds. The number of reports generated is controlled by the -- report-count option. By default, one report is generated. For example, if the value of -- relative is 60, two reports are generated: The first report is generated immediately, and the second report is generated again 60 seconds later. The value in the second report will be related to the previous one. For example, the previous query contains a total of 10.00 k queries and received a new 1.00 k query at the 60-second interval, the total number of queries in the second report is 1.00 k, not 11.00 k.

If the value of the -- relative option can also be a local file (similar to the -- infile option), mysqlreport will generate status reports in sequence according to the file order in the parameter values. Therefore, it is very important to specify the option value based on the time when these files are generated: The files generated earlier are placed before the parameters. The first file must contain manually added system variables, such as key_buffer_size and table_cache. Each file can have multiple "show status" results. Note: Status files generated by "mysqladmin-r-I N extended" cannot be used because the-r parameter of mysqladmin has generated relative status values.

Mysqlreport first writes the status report to a temporary file. if the value of -- relative is an integer (rather than a local file), mysqlreport displays where it writes the file. Then you can directly view the file content to observe the server's status.
-- Report-count (-c) N generates N relevant reports. This option is valid only when the -- relative option is enabled at the same time. Mysqlreport will automatically generate N + 1 report: the first basic report and the subsequent N relevant reports.
-- Detach if this option is specified, mysqlreport will derive a process, not only display the results on the screen, but also go to the background to continue running. After a new process is derived, mysqlreport reports the temporary file to which the result is written. This option can also specify one of -- outfile or -- email. If the value of -- outfile or -- email is not specified, the generated temporary file will be deleted, because after mysqlreport derives a new process, the result cannot be printed on the terminal screen. This option makes more sense if it is used with -- relative, so that mysqlreport can report information on a regular basis, without the need for manual logon or other methods to interrupt execution. Use the following command to generate a report for mysqlrepot every hour and send the report to your mailbox:
Mysqlreport-r 3600-detach-email host@domain.com

When I was a child, mysqlreport sent a report via email, deleted temporary files, and ended cleanly.
-- Debug: displays debugging information.
-- Dtq (in the Total part of the Questions report) shows all query distribution reports. These queries mainly include the following four parts: DMS (see below), COM _ (see below), COM_QUIT (see COM_QUIT and Questions), and other unknown. Each part is displayed in reverse order based on its total number.
-- Dms (DMS in the Questions report) displays all data maintenance statements (DMS) reports. DMS is the one mentioned in the following document 13.2. Data Manipulation Statements (currently mainly include SELECT, INSERT, REPLACE, UPDATE, and DELETE ). Each DMS is displayed in reverse order based on its total number.
-- Com N (after the Questions report) displays up to N non-DMS Com _ status values in descending order. If N is not specified, the default value is 3. The so-called non-DMS Com _ status values, including Com_change_db, Com_show_tables, and Com_rollback.
-- Sas (after the Questions report) displays all the Select _ and Sort _ reports. For details, see MySQL Select and Sort Status Variables.
-- Qcache: if the query cache is enabled, the query cache status report is displayed.
-- Tab (after the Create Temp report) displays the status reports of threads, abandoned, and traffic. Starting from mysqlreport v2.3, the thread status is read from the Threads _ status value.
-- Innodb displays InnoDB status reports, including InnoDB buffer pools supported after MySQL 5.0.2 and InnoDB lock status reports supported after MySQL 5.0.3.
-- Innodb-only displays only InnoDB reports; no other reports.
-- Dpr displays InnoDB data, pages, and row reports.
-- All: if possible, all status reports are displayed. Some reports, such as query cache and InnoDB, must be supported by a specific version of MySQL or other features. For example, if the server supports query cache, but it is disabled, no query cache report is displayed whether or not -- qcache or -- all is specified.

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.