and option C<--port=12345> are
specified, then the tool automatically adds C to DSN.
=head2 ESCAPING VALUES
DSNs are usually specified on the command line, so shell quoting and escaping
must be taken into account. Special characters, like asterisk (C<*>), 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 (C<\>). 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 C,
it must be specified as C on most shells. This applies to DSNs
and DSN-related options like C<--user>.
=head2 KEY PARTS
Many 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:
=over
=item A
Specifies the default character set for the connection.
Enables character set settings in Perl and MySQL. If the value is C, sets
Perl's binmode on STDOUT to utf8, passes the C option to
DBD::mysql, and runs C after connecting to MySQL. Any other
value sets binmode on STDOUT without the utf8 layer, and runs C after
connecting to MySQL.
Unfortunately, there is no way from within Perl itself to specify the client
library's character set. C only affects the server; if the client
library's settings don't match, there could be problems. You can use the
defaults file to specify the client library's character set, however. See the
description of the F part below.
=item D
Specifies the connection's default database.
=item F
Specifies a defaults file the mysql client library (the C client library used by
DBD::mysql, I) should read. The tools all read the
[client] section within the defaults file. If you omit this, the standard
defaults files will be read in the usual order. "Standard" varies from system
to system, because the filenames to read are compiled into the client library.
On Debian systems, for example, it's usually /etc/mysql/my.cnf then ~/.my.cnf.
If you place the following into ~/.my.cnf, tools will Do The Right Thing:
[client]
user=your_user_name
pass=secret
Omitting the F part is usually the right thing to do. As long as you have
configured your ~/.my.cnf correctly, that will result in tools connecting
automatically without needing a username or password.
You can also specify a default character set in the defaults file. Unlike the
L<"A"> part described above, this will actually instruct the client library
(DBD::mysql) to change the character set it uses internally, which cannot be
accomplished any other way as far as I know, except for C.
=item h
Hostname or IP address for the connection.
=item p
Password to use when connecting.
=item P
Port number to use for the connection. Note that the usual special-case
behaviors apply: if you specify C as your hostname on Unix systems,
the connection actually uses a socket file, not a TCP/IP connection, and thus
ignores the port.
=item S
Socket file to use for the connection (on Unix systems).
=item u
User for login if not current user.
=back
=head2 BAREWORD
Many of the tools will let you specify a DSN as a single word, without any
C syntax. This is called a 'bareword'. How this is handled is
tool-specific, but it is usually interpreted as the L<"h"> part. The tool's
C<--help> output will tell you the behavior for that tool.
=head2 PROPAGATION
Many 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.
=head1 ENVIRONMENT
The environment variable C 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.
=head1 SYSTEM REQUIREMENTS
Most tools require:
=over
=item * Perl v5.8 or newer
=item * Bash v3 or newer
=item * Core Perl modules like Time::HiRes
=back
Tools that connect to MySQL require:
=over
=item * Perl modules DBI and DBD::mysql
=item * MySQL 5.0 or newer
=back
Percona Toolkit is only tested on UNIX systems, primarily Debian and
Red Hat derivatives; other operating systems are not supported.
Tools that connect to MySQL may work with MySQL v4.1, but this is not
test or supported.
=head1 BUGS
Please report bugs at L.
Include the following information in your bug report:
=over
=item * Complete command-line used to run the tool
=item * Tool C<--version>
=item * MySQL version of all servers involved
=item * Output from the tool including STDERR
=item * Input files (log/dump/config files, etc.)
=back
If possible, include debugging output by running the tool with C;
see L<"ENVIRONMENT">.
=head1 AUTHORS
Percona Toolkit is primarily developed by Baron Schwartz and Daniel Nichter,
both of whom are employed by Percona Inc. See each program's documentation
for details.
=head1 COPYRIGHT, LICENSE, AND WARRANTY
Percona Toolkit is copyright 2011-2012 Percona Inc. and others.
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.
=head1 VERSION
Percona Toolkit v2.1.7 released 2012-11-19
=cut