Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using filters for replication:

replicate-wild-do-table = test_slave.%
replicate-rewrite-db = test->test_slave

Is there an option to specify different DB name on slave for "pt-table-checksum"

pt-table-checksum --host=localhost --databases=test --max-load=Threads_connected:25 --no-check-replication-filters


mysql> SELECT COUNT(*) FROM information_schema.TABLES WHERE TABLE_SCHEMA = 'test_slave';
| COUNT(*) |
|      145 |
1 row in set (0.00 sec)

mysql> SELECT COUNT(*) FROM percona.checksums;
| COUNT(*) |
|       40 |
1 row in set (0.00 sec)


# ls -l *.frm | wc -l
# ls -l | awk '{print $3,$4}' | uniq

mysql mysql

It's also complaining that two tables have no indexes and are oversized. It looks like it's just skipping some tables?

share|improve this question
Are there tables with no primary keys and unique keys ? – RolandoMySQLDBA Jun 6 '13 at 18:32
Yes, there is few tables (~10) without indexes, I've tried to checksum table that was skipped but it doesn't return any output and the exist status is zero. – HTF Jun 6 '13 at 20:24
Tables without primary keys and unique indexes cannot get a checksum done because a hash is done based in part on a unique value. In those 10 instances, simply mysqldump those 10 tables from the master and load them into the slave. – RolandoMySQLDBA Jun 6 '13 at 20:26
This still doesn't sum up to 145 but thanks for your help. – HTF Jun 6 '13 at 20:57
up vote 1 down vote accepted

I don't see anything along those lines in the Percona Toolkit Documentation.

There is something you can do to cheat


  • datadir is /var/lib/mysql
  • Master has test database
  • Slave has test_slave database

You could create a symbolic link in one of two ways


On the Master, run

ln -s /var/lib/mysql/test /var/lib/mysql/test_slave
chown mysql:mysql /var/lib/mysql/test_slave


On the Slave (if there is no test database), run

ln -s /var/lib/mysql/test_slave /var/lib/mysql/test
chown mysql:mysql /var/lib/mysql/test


Once you created the symbolic link, you can run the checksum against test

pt-table-checksum --host=localhost --databases=test --max-load=Threads_connected:25 --no-check-replication-filters

or against test_slave

pt-table-checksum --host=localhost --databases=test_slave --max-load=Threads_connected:25 --no-check-replication-filters


When done, you can remove the symbolic link.

Give it a Try !!!

share|improve this answer
Thanks for your reply. Do you have any idea why "pt-table-checksum" is checking only few tables (please see edit section in question)? – HTF Jun 6 '13 at 18:08
Are the 40 entries in percona.checksums all mismatches ? – RolandoMySQLDBA Jun 6 '13 at 18:10
Run this: cd /var/lib/mysql/test_slave ; ls -l *.frm | wc -l. This should be 145. Then, run ls -l | awk '{print $3,$4}' | uniq. Do you see anything other than mysql mysql ? – RolandoMySQLDBA Jun 6 '13 at 18:15
There was only one mismatch. Please see "EDIT 2". – HTF Jun 6 '13 at 18:28

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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