1MK-CONFIG-DIFF(1) User Contributed Perl Documentation MK-CONFIG-DIFF(1)
2
3
4
6 mk-config-diff - Diff MySQL configuration files and server variables.
7
9 Usage: mk-config-diff [OPTION...] CONFIG CONFIG [CONFIG...]
10
11 mk-config-diff diffs MySQL configuration files and server variables.
12 CONFIG can be a filename or a DSN. At least two CONFIG sources must be
13 given. Like standard Unix diff, there is no output if there are no
14 differences.
15
16 Diff host1 config from SHOW VARIABLES against host2:
17
18 mk-config-diff h=host1 h=host2
19
20 Diff config from [mysqld] section in my.cnf against host1 config:
21
22 mk-config-diff /etc/my.cnf h=host1
23
24 Diff the [mysqld] section of two option files:
25
26 mk-config-diff /etc/my-small.cnf /etc/my-large.cnf
27
29 The following section is included to inform users about the potential
30 risks, whether known or unknown, of using this tool. The two main
31 categories of risks are those created by the nature of the tool (e.g.
32 read-only tools vs. read-write tools) and those created by bugs.
33
34 mk-config-diff reads MySQL's configuration and examines it and is thus
35 very low risk.
36
37 At the time of this release there are no known bugs that pose a serious
38 risk.
39
40 The authoritative source for updated information is always the online
41 issue tracking system. Issues that affect this tool will be marked as
42 such. You can see a list of such issues at the following URL:
43 <http://www.maatkit.org/bugs/mk-config-diff>.
44
45 See also "BUGS" for more information on filing bugs and getting help.
46
48 mk-config-diff diffs MySQL configurations by examining the values of
49 server system variables from two or more CONFIG sources specified on
50 the command line. A CONFIG source can be a DSN or a filename
51 containing the output of "mysqld --help --verbose",
52 "my_print_defaults", "SHOW VARIABLES", or an option file (e.g. my.cnf).
53
54 For each DSN CONFIG, mk-config-diff connects to MySQL and gets
55 variables and values by executing "SHOW /*!40103 GLOBAL*/ VARIABLES".
56 This is an "active config" because it shows what server values MySQL is
57 actively (currently) running with.
58
59 Only variables that all CONFIG sources have are compared because if a
60 variable is not present then we cannot know or safely guess its value.
61 For example, if you compare an option file (e.g. my.cnf) to an active
62 config (i.e. SHOW VARIABLES from a DSN CONFIG), the option file will
63 probably only have a few variables, whereas the active config has every
64 variable. Only values of the variables present in both configs are
65 compared.
66
67 Option file and DSN configs provide the best results.
68
70 There is no output when there are no differences. When there are
71 differences, mk-config-diff prints a report to STDOUT that looks
72 similar to the following:
73
74 2 config differences
75 Variable my.master.cnf my.slave.cnf
76 ========================= =============== ===============
77 datadir /tmp/12345/data /tmp/12346/data
78 port 12345 12346
79
80 Comparing MySQL variables is difficult because there are many
81 variations and subtleties across the many versions and distributions of
82 MySQL. When a comparison fails, the tool prints a warning to STDERR,
83 such as the following:
84
85 Comparing log_error values (mysqld.log, /tmp/12345/data/mysqld.log)
86 caused an error: Argument "/tmp/12345/data/mysqld.log" isn't numeric
87 in numeric eq (==) at ./mk-config-diff line 2311.
88
89 Please report these warnings so the comparison functions can be
90 improved.
91
93 mk-config-diff exits with a zero exit status when there are no
94 differences, and 1 if there are.
95
97 This tool accepts additional command-line arguments. Refer to the
98 "SYNOPSIS" and usage information for details.
99
100 --ask-pass
101 Prompt for a password when connecting to MySQL.
102
103 --charset
104 short form: -A; type: string
105
106 Default character set. If the value is utf8, sets Perl's binmode
107 on STDOUT to utf8, passes the mysql_enable_utf8 option to
108 DBD::mysql, and runs SET NAMES UTF8 after connecting to MySQL. Any
109 other value sets binmode on STDOUT without the utf8 layer, and runs
110 SET NAMES after connecting to MySQL.
111
112 --config
113 type: Array
114
115 Read this comma-separated list of config files; if specified, this
116 must be the first option on the command line. (This option does
117 not specify a CONFIG; it's equivalent to "--defaults-file".)
118
119 --daemonize
120 Fork to the background and detach from the shell. POSIX operating
121 systems only.
122
123 --defaults-file
124 short form: -F; type: string
125
126 Only read mysql options from the given file. You must give an
127 absolute pathname.
128
129 --help
130 Show help and exit.
131
132 --host
133 short form: -h; type: string
134
135 Connect to host.
136
137 --ignore-variables
138 type: array
139
140 Ignore, do not compare, these variables.
141
142 --password
143 short form: -p; type: string
144
145 Password to use for connection.
146
147 --pid
148 type: string
149
150 Create the given PID file when daemonized. The file contains the
151 process ID of the daemonized instance. The PID file is removed
152 when the daemonized instance exits. The program checks for the
153 existence of the PID file when starting; if it exists and the
154 process with the matching PID exists, the program exits.
155
156 --port
157 short form: -P; type: int
158
159 Port number to use for connection.
160
161 --[no]report
162 default: yes
163
164 Print the MySQL config diff report to STDOUT. If you just want to
165 check if the given configs are different or not by examining the
166 tool's exit status, then specify "--no-report" to suppress the
167 report.
168
169 --report-width
170 type: int; default: 78
171
172 Truncate report lines to this many characters. Since some variable
173 values can be long, or when comparing multiple configs, it may help
174 to increase the report width so values are not truncated beyond
175 readability.
176
177 --set-vars
178 type: string; default: wait_timeout=10000
179
180 Set these MySQL variables. Immediately after connecting to MySQL,
181 this string will be appended to SET and executed.
182
183 --socket
184 short form: -S; type: string
185
186 Socket file to use for connection.
187
188 --user
189 short form: -u; type: string
190
191 MySQL user if not current user.
192
193 --version
194 Show version and exit.
195
197 These DSN options are used to create a DSN. Each option is given like
198 "option=value". The options are case-sensitive, so P and p are not the
199 same option. There cannot be whitespace before or after the "=" and if
200 the value contains whitespace it must be quoted. DSN options are
201 comma-separated. See the maatkit manpage for full details.
202
203 · A
204
205 dsn: charset; copy: yes
206
207 Default character set.
208
209 · D
210
211 dsn: database; copy: yes
212
213 Default database.
214
215 · F
216
217 dsn: mysql_read_default_file; copy: yes
218
219 Only read default options from the given file
220
221 · h
222
223 dsn: host; copy: yes
224
225 Connect to host.
226
227 · p
228
229 dsn: password; copy: yes
230
231 Password to use when connecting.
232
233 · P
234
235 dsn: port; copy: yes
236
237 Port number to use for connection.
238
239 · S
240
241 dsn: mysql_socket; copy: yes
242
243 Socket file to use for connection.
244
245 · u
246
247 dsn: user; copy: yes
248
249 User for login if not current user.
250
252 You can download Maatkit from Google Code at
253 <http://code.google.com/p/maatkit/>, or you can get any of the tools
254 easily with a command like the following:
255
256 wget http://www.maatkit.org/get/toolname
257 or
258 wget http://www.maatkit.org/trunk/toolname
259
260 Where "toolname" can be replaced with the name (or fragment of a name)
261 of any of the Maatkit tools. Once downloaded, they're ready to run; no
262 installation is needed. The first URL gets the latest released version
263 of the tool, and the second gets the latest trunk code from Subversion.
264
266 The environment variable "MKDEBUG" enables verbose debugging output in
267 all of the Maatkit tools:
268
269 MKDEBUG=1 mk-....
270
272 You need the following Perl modules: DBI and DBD::mysql.
273
275 For a list of known bugs see
276 <http://www.maatkit.org/bugs/mk-config-diff>.
277
278 Please use Google Code Issues and Groups to report bugs or request
279 support: <http://code.google.com/p/maatkit/>. You can also join
280 #maatkit on Freenode to discuss Maatkit.
281
282 Please include the complete command-line used to reproduce the problem
283 you are seeing, the version of all MySQL servers involved, the complete
284 output of the tool when run with "--version", and if possible,
285 debugging output produced by running with the "MKDEBUG=1" environment
286 variable.
287
289 This program is copyright 2009-2011 Percona Inc. Feedback and
290 improvements are welcome.
291
292 THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
293 WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
294 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
295
296 This program is free software; you can redistribute it and/or modify it
297 under the terms of the GNU General Public License as published by the
298 Free Software Foundation, version 2; OR the Perl Artistic License. On
299 UNIX and similar systems, you can issue `man perlgpl' or `man
300 perlartistic' to read these licenses.
301
302 You should have received a copy of the GNU General Public License along
303 with this program; if not, write to the Free Software Foundation, Inc.,
304 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
305
307 Baron Schwartz, Daniel Nichter
308
310 This tool is part of Maatkit, a toolkit for power users of MySQL.
311 Maatkit was created by Baron Schwartz; Baron and Daniel Nichter are the
312 primary code contributors. Both are employed by Percona. Financial
313 support for Maatkit development is primarily provided by Percona and
314 its clients.
315
317 This manual page documents Ver 1.0.0 Distrib 7540 $Revision: 7477 $.
318
319
320
321perl v5.32.0 2020-07-28 MK-CONFIG-DIFF(1)