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

3 Answers 3


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

  • This is a great answer. I looked around a lot for such a clear guide on this. Thanks.
    – Haluk
    Aug 11, 2012 at 22:48

You should be able to shell script such automation

I posted a shell script I use to automate mk-table-checksum and mk-table-sync : Fixing tables out of sync as reported by pt-table-checksum, pt-table-sync is not working (Dec 5, 2011)

The script does the following:

  • accepts the IP addresses of Master and Slave as command-line parameters
  • retrieve the list of all databases
  • run mk-table-checksum on all the databases
  • generates a list of tables (each line has dbname.tbname) that have mismatched checksums
  • executes mk-table-sync and generates the SQL to sync the Slave
    • It does execute the generated SQL
    • It gives you the opportunity to manually look over the changes
    • When the changes look legitimate to you, you can manually run the SQL on the Slave

In that script, there are two lines


You can easily replace them in the script with the absolute path of your pt-table-checksum and pt-table-sync. You can also augment the script to use a list of files rather than an entire DB Instance.

  • I like this approach. We also have a wrapper around pt-table-checksum which checks which of our active/passive master/master pair is active and only runs the checksum on that server. Aug 9, 2012 at 19:59

It's not possible to read options from file you have to pass them along with utility on command line you can create a job file which runs as a Cronjob.

I think it will be better to have reading arguments from file, You can ask Percona about such configuration options here: http://www.percona.com/bugs/pt-table-checksum

  • There is a --config option to read arguments from a file. Aug 9, 2012 at 20:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.