|
NAMEpercona-toolkit - Advanced command-line tools for MySQLDESCRIPTIONPercona Toolkit is a collection of advanced command-line tools used by Percona (<http://www.percona.com/>) support staff to perform a variety of MySQL and system tasks that are too difficult or complex to perform manually.These tools are ideal alternatives to private or "one-off" scripts because they are professionally developed, formally tested, and fully documented. They are also fully self-contained, so installation is quick and easy and no libraries are installed. Percona Toolkit is derived from Maatkit and Aspersa, two of the best-known toolkits for MySQL server administration. It is developed and supported by Percona. For more information and other free, open-source software developed by Percona, visit <http://www.percona.com/software/>. TOOLSThis release of Percona Toolkit includes the following tools:
For more free, open-source software developed Percona, visit <http://www.percona.com/software/>. SPECIAL OPTION TYPESTool options use standard types ("int", "string", etc.) as well as these special types:
CONFIGURATION FILESPercona Toolkit tools can read options from configuration files. The configuration file syntax is simple and direct, and bears some resemblances to the MySQL command-line client tools. The configuration files all follow the same conventions.Internally, what actually happens is that the lines are read from the file and then added as command-line options and arguments to the tool, so just think of the configuration files as a way to write your command lines. SYNTAXThe syntax of the configuration files is as follows:
EXAMPLEThis config file for pt-stalk,# Config for pt-stalk variable=Threads_connected cycles=2 # trigger if problem seen twice in a row -- --user daniel is equivalent to this command line: pt-stalk --variable Threads_connected --cycles 2 -- --user daniel Options after "--" are passed literally to mysql and mysqladmin. READ ORDERThe tools read several configuration files in order:
SPECIFYINGThere is a special "--config" option, which lets you specify which configuration files Percona Toolkit should read. You specify a comma-separated list of files. However, its behavior is not like other command-line options. It must be given first on the command line, before any other options. If you try to specify it anywhere else, it will cause an error. Also, you cannot specify "--config=/path/to/file"; you must specify the option and the path to the file separated by whitespace without an equal sign between them, like:--config /path/to/file If you don't want any configuration files at all, specify "--config ''" to provide an empty list of files. DSN (DATA SOURCE NAME) SPECIFICATIONSPercona Toolkit tools use DSNs to specify how to create a DBD connection to a MySQL server. A DSN is a comma-separated string of "key=value" parts, like:h=host1,P=3306,u=bob The standard key parts are shown below, but some tools add additional key parts. See each tool's documentation for details. Some tools do not use DSNs but still connect to MySQL using options like "--host", "--user", and "--password". Such tools uses these options to create a DSN automatically, behind the scenes. Other tools uses both DSNs and options like the ones above. The options provide defaults for all DSNs that do not specify the option's corresponding key part. For example, if DSN "h=host1" and option "--port=12345" are specified, then the tool automatically adds "P=12345" to DSN. ESCAPING VALUESDSNs are usually specified on the command line, so shell quoting and escaping must be taken into account. Special characters, like asterisk ("*"), need to be quoted and/or escaped properly to be passed as literal characters in DSN values.Since DSN parts are separated by commas, literal commas in DSN values must be escaped with a single backslash ("\"). And since a backslash is the escape character for most shells, two backslashes are required to pass a literal backslash. For example, if the username is literally "my,name", it must be specified as "my\\,name" on most shells. This applies to DSNs and DSN-related options like "--user". KEY PARTSMany of the tools add more parts to DSNs for special purposes, and sometimes override parts to make them do something slightly different. However, all the tools support at least the following:
BAREWORDMany of the tools will let you specify a DSN as a single word, without any "key=value" syntax. This is called a 'bareword'. How this is handled is tool-specific, but it is usually interpreted as the "h" part. The tool's "--help" output will tell you the behavior for that tool.PROPAGATIONMany tools will let you propagate values from one DSN to the next, so you don't have to specify all the parts for each DSN. For example, if you want to specify a username and password for each DSN, you can connect to three hosts as follows:h=host1,u=fred,p=wilma host2 host3 This is tool-specific. ENVIRONMENTThe environment variable "PTDEBUG" enables verbose debugging output to STDERR. To enable debugging and capture all output to a file, run the tool like:PTDEBUG=1 pt-table-checksum ... > FILE 2>&1 Be careful: debugging output is voluminous and can generate several megabytes of output. SYSTEM REQUIREMENTSMost tools require:
Tools that connect to MySQL require:
Percona Toolkit officially supports and is tested on many popular Linux distributions and MySQL 5.0 through 5.6; see http://goo.gl/srHm7 for the list of supported platforms and versions. IPv6 supportIn order to support IPv6 addresses to connect to MySQL, Perl DBD::MySQL driver v4.033_01 is required. Also, as stated in RFC 3986 <https://www.ietf.org/rfc/rfc3986.txt> section 3.2.2 brackes must be used to distinguish host and port. Examples: <https://metacpan.org/pod/DBD::mysql#port>BUGSPlease report bugs at <https://jira.percona.com>. Include the following information in your bug report:
If possible, include debugging output by running the tool with "PTDEBUG"; see "ENVIRONMENT". AUTHORS
COPYRIGHT, LICENSE, AND WARRANTYPercona Toolkit is copyright 2011-2020 Percona LLC and/or its affiliates, et al. See each program's documentation for complete copyright notices.THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2; OR the Perl Artistic License. On UNIX and similar systems, you can issue `man perlgpl' or `man perlartistic' to read these licenses. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. VERSIONPercona Toolkit v3.3.1 released 2021-04-22
Visit the GSP FreeBSD Man Page Interface. |