|
NAMEpt-config-diff - Diff MySQL configuration files and server variables.SYNOPSISUsage: pt-config-diff [OPTIONS] CONFIG CONFIG [CONFIG...]pt-config-diff diffs MySQL configuration files and server variables. CONFIG can be a filename or a DSN. At least two CONFIG sources must be given. Like standard Unix diff, there is no output if there are no differences. Diff host1 config from SHOW VARIABLES against host2: pt-config-diff h=host1 h=host2 Diff config from [mysqld] section in my.cnf against host1 config: pt-config-diff /etc/my.cnf h=host1 Diff the [mysqld] section of two option files: pt-config-diff /etc/my-small.cnf /etc/my-large.cnf RISKSPercona Toolkit is mature, proven in the real world, and well tested, but all database tools can pose a risk to the system and the database server. Before using this tool, please:
DESCRIPTIONpt-config-diff diffs MySQL configurations by examining the values of server system variables from two or more CONFIG sources specified on the command line. A CONFIG source can be a DSN or a filename containing the output of "mysqld --help --verbose", "my_print_defaults", "SHOW VARIABLES", or an option file (e.g. my.cnf).For each DSN CONFIG, pt-config-diff connects to MySQL and gets variables and values by executing "SHOW /*!40103 GLOBAL*/ VARIABLES". This is an "active config" because it shows what server values MySQL is actively (currently) running with. Only variables that all CONFIG sources have are compared because if a variable is not present then we cannot know or safely guess its value. For example, if you compare an option file (e.g. my.cnf) to an active config (i.e. SHOW VARIABLES from a DSN CONFIG), the option file will probably only have a few variables, whereas the active config has every variable. Only values of the variables present in both configs are compared. Option file and DSN configs provide the best results. OUTPUTThere is no output when there are no differences. When there are differences, pt-config-diff prints a report to STDOUT that looks similar to the following:2 config differences Variable my.master.cnf my.slave.cnf ========================= =============== =============== datadir /tmp/12345/data /tmp/12346/data port 12345 12346 Comparing MySQL variables is difficult because there are many variations and subtleties across the many versions and distributions of MySQL. When a comparison fails, the tool prints a warning to STDERR, such as the following: Comparing log_error values (mysqld.log, /tmp/12345/data/mysqld.log) caused an error: Argument "/tmp/12345/data/mysqld.log" isn't numeric in numeric eq (==) at ./pt-config-diff line 2311. Please report these warnings so the comparison functions can be improved. EXIT STATUSpt-config-diff exits with a zero exit status when there are no differences, and 1 if there are.OPTIONSThis tool accepts additional command-line arguments. Refer to the "SYNOPSIS" and usage information for details.
DSN OPTIONSThese DSN options are used to create a DSN. Each option is given like "option=value". The options are case-sensitive, so P and p are not the same option. There cannot be whitespace before or after the "=" and if the value contains whitespace it must be quoted. DSN options are comma-separated. See the percona-toolkit manpage for full details.
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-config-diff ... > FILE 2>&1 Be careful: debugging output is voluminous and can generate several megabytes of output. SYSTEM REQUIREMENTSYou need Perl, DBI, DBD::mysql, and some core packages that ought to be installed in any reasonably new version of Perl.BUGSFor a list of known bugs, see <http://www.percona.com/bugs/pt-config-diff>.Please report bugs at <https://jira.percona.com/projects/PT>. Include the following information in your bug report:
If possible, include debugging output by running the tool with "PTDEBUG"; see "ENVIRONMENT". DOWNLOADINGVisit <http://www.percona.com/software/percona-toolkit/> to download the latest release of Percona Toolkit. Or, get the latest release from the command line:wget percona.com/get/percona-toolkit.tar.gz wget percona.com/get/percona-toolkit.rpm wget percona.com/get/percona-toolkit.deb You can also get individual tools from the latest release: wget percona.com/get/TOOL Replace "TOOL" with the name of any tool. AUTHORSBaron Schwartz and Daniel NichterABOUT PERCONA TOOLKITThis tool is part of Percona Toolkit, a collection of advanced command-line tools for MySQL developed by Percona. Percona Toolkit was forked from two projects in June, 2011: Maatkit and Aspersa. Those projects were created by Baron Schwartz and primarily developed by him and Daniel Nichter. Visit <http://www.percona.com/software/> to learn about other free, open-source software from Percona.COPYRIGHT, LICENSE, AND WARRANTYThis program is copyright 2011-2018 Percona LLC and/or its affiliates.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. VERSIONpt-config-diff 3.3.1
Visit the GSP FreeBSD Man Page Interface. |