major.io words of wisdom from a systems engineer

Comparing MySQL result sets quickly

I found a really helpful tip on Xaprb for comparing result sets in MySQL:

mysql> pager md5sum -
PAGER set to 'md5sum -'
mysql> select * from test;
a09bc56ac9aa0cbcc659c3d566c2c7e4  -
4096 rows in set (0.00 sec)

It’s a quick way to determine if you have two tables that are properly in sync. Although there are better ways to compare tables in replicated environments, this method can get it done pretty quickly.