How to use pt-table-checksum

Hi All,

I am new to percona and want to use pt-table-checksum to check differences between my master mysql database and backup mysql database. I want the pt-table-checksum to show errors if there are difference between these two and not to make any other changes. Also, i want to be as minimalistic as possible while my objective is to solely report the difference between the master and the backup.

Also, the backup is in a docker container so doesn’t want to hardcode or make things hairy.

can someone give me the syntax on how to do this? i am looking for instructions on how to give username,password and hostname for both the master and the backup mysql databases.

Thanks
Eswar

Hi,
I think this will provide a nice introduction into the tool:

1 Like

For example what I usually type (on the master) is

time pt-table-checksum h=127.0.0.1,u=userr,p=superPassword,P=3306 --databases=myDB --tables=myTable

Then once finished on the slave I execute

SELECT db,tbl, count(*) as delta
FROM percona.checksums
WHERE this_crc != master_crc
OR this_cnt != master_cnt
group by db, tbl

To check if there are differences

1 Like