Useful if you need to check db replica after sync.
Usage:
go run main.go \
"root:password@tcp(127.0.0.1:3306)/db1" \
"root:password@tcp(127.0.0.1:3306)/db2"
Compares every table in first db with same table in second db.
It uses CHECKSUM TABLE
but if you're using MySQL 5.7.x there can be bug with tables with json columns: identical tables produce different CHECKSUM TABLE on different connections.
So if checksum doesn't match it will compare counts, first row, last row and 1000 random rows.
Example how to create databse for testing.
mysqldump -u root --password=password db1 | mysql -u root --password=password db2