+1-208-473-2904 (USA - Sales)
Percona 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.
The syntax of the configuration files is as follows:
Whitespace followed by a hash sign (#) signifies that the rest of the line is a comment. This is deleted. For example:
Whitespace is stripped from the beginning and end of all lines.
Empty lines are ignored.
Each line is permitted to be in either of the following formats:option option=value
Do not prefix the option with --. Do not quote the values, even if it has spaces; value are literal. Whitespace around the equals sign is deleted during processing.
Only long options are recognized.
A line containing only two hyphens signals the end of option parsing. Any further lines are interpreted as additional arguments (not options) to the program.
This 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.
The tools read several configuration files in order:
There 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:
If you don’t want any configuration files at all, specify --config '' to provide an empty list of files.