Mysql – Is it possible to pass parameters to pt-table-checksum using an options file

MySQLperconapercona-tools

We're using Percona's pt-table-checksum for MySQL replication integrity check.
Is it possible to pass some or all of the options using some sort of configuration file?

For instance, can we write the list of tables we want checked in a file?
I understand the manual does not talk about such a file: http://www.percona.com/doc/percona-toolkit/2.1/pt-table-checksum.html

Best Answer

Yes, you can do this.

pt-table-checksum --config FILENAME

Where FILENAME looks like

tables                  = table1,table2,table3
ignore-tables-regex     = ^tmp
chunk-time              = .2
max-load                = Threads_running=10
chunk-size              = 100000
user                    = myuser
pass                    = mypass

If --config is not specified, pt-table-checksum will read from /etc/percona-toolkit/pt-table-checksum.conf by default. Nearly all Percona Toolkit tools have this ability.

Details on how the config files work is available here