TwinDB Table Compare reads percona.checksums from the master and slave and shows what records are difference if there are any inconsistencies.
Project description
TwinDB Table Compare
TwinDB Table Compare reads percona.checksums from the master and slave and shows what records are difference if there are any inconsistencies.
Free software: Apache Software License 2.0
Documentation: https://twindb-table-compare.readthedocs.io.
Blogpost with usage examples: https://twindb.com/pt-table-checksum-show-differences/
Usage
TwinDB Table Compare should be used in the command line.
This will show differences in data between slave and its master.
twindb_table_compare slave
where slave is a hostname of a MySQL slave.
[root@master vagrant]# twindb_table_compare --user=dba --password=qwerty 192.168.35.251 2016-09-03 22:48:01,732: INFO: twindb_table_compare.get_inconsistencies():127: Executing: SELECT chunk FROM `percona`.`checksums` WHERE (this_crc<>master_crc OR this_cnt<>master_cnt) AND db='mysql' AND tbl='proxies_priv' 2016-09-03 22:48:01,734: INFO: twindb_table_compare.get_inconsistencies():138: Found 1 inconsistent chunk 2016-09-03 22:48:01,734: INFO: twindb_table_compare.get_inconsistencies():141: # mysql.proxies_priv, chunk 1 2016-09-03 22:48:01,736: INFO: twindb_table_compare.get_inconsistencies():143: # chunk index: None 2016-09-03 22:48:01,736: INFO: twindb_table_compare.get_inconsistencies():215: Executing: SELECT * FROM `mysql`.`proxies_priv` WHERE 1 2016-09-03 22:48:01,743: INFO: twindb_table_compare.get_inconsistencies():257: Differences between slave 192.168.35.251 and its master: --- /tmp/master.GZ8S7V 2016-09-03 22:48:01.737762174 +0000 +++ /tmp/slave.9t4HhV 2016-09-03 22:48:01.738761674 +0000 @@ -1,2 +1,2 @@ -localhost root 1 2016-09-03 20:02:28 -master.box root 1 2016-09-03 20:02:28 +localhost root 1 2016-09-03 20:10:04 +slave.box root 1 2016-09-03 20:10:04 2016-09-03 22:48:01,746: INFO: twindb_table_compare.get_inconsistencies():127: Executing: SELECT chunk FROM `percona`.`checksums` WHERE (this_crc<>master_crc OR this_cnt<>master_cnt) AND db='mysql' AND tbl='user' 2016-09-03 22:48:01,747: INFO: twindb_table_compare.get_inconsistencies():138: Found 1 inconsistent chunk 2016-09-03 22:48:01,747: INFO: twindb_table_compare.get_inconsistencies():141: # mysql.user, chunk 1 2016-09-03 22:48:01,747: INFO: twindb_table_compare.get_inconsistencies():143: # chunk index: None 2016-09-03 22:48:01,748: INFO: twindb_table_compare.get_inconsistencies():215: Executing: SELECT * FROM `mysql`.`user` WHERE 1 2016-09-03 22:48:01,757: INFO: twindb_table_compare.get_inconsistencies():257: Differences between slave 192.168.35.251 and its master: --- /tmp/master.l_zYw7 2016-09-03 22:48:01.749756174 +0000 +++ /tmp/slave.39qG9N 2016-09-03 22:48:01.752754674 +0000 @@ -1,9 +1,9 @@ localhost root Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y 0 0 0 0 mysql_native_password N -master.box root Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y 0 0 0 0 mysql_native_password N +slave.box root Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y 0 0 0 0 mysql_native_password N 127.0.0.1 root Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y 0 0 0 0 mysql_native_password N ::1 root Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y 0 0 0 0 mysql_native_password N localhost N N N N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0 mysql_native_password None N -master.box N N N N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0 mysql_native_password None N +slave.box N N N N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0 mysql_native_password None N % dba *AA1420F182E88B9E5F874F6FBE7459291E8F4601 Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y 0 0 0 0 mysql_native_password N localhost dba *AA1420F182E88B9E5F874F6FBE7459291E8F4601 Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y 0 0 0 0mysql_native_password N % repl *809534247D21AC735802078139D8A854F45C31F3 N N N N N N N N N N N N N N N N N N N Y N N N N N N N N N 0 0 0 0 mysql_native_password N
Run twindb_table_compare --help for other options.
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
History
0.1.0 (2016-08-29)
First release on PyPI.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for twindb_table_compare-1.1.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59608fccc74959e9810f21a2fe52bf1e33bdc095758c917aa6f7f653a922688b |
|
MD5 | a56ace9eb6fe2115a6e10527d626ef82 |
|
BLAKE2b-256 | 113911bf424357ea3407c2a38cf04a37b64197e33196cf262b0304cbe9cb9abd |
Hashes for twindb_table_compare-1.1.4-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 55888f553a4d8d92055f919518d927153d4f759de86006201bfcb8fdd92add1c |
|
MD5 | ad339515292f80ee5107a7c0c62b4dec |
|
BLAKE2b-256 | 809e77be17c6e68808b5d442643b925a644eeca3f9314221b4708b4f6806765d |