June 27th, 2013, 03:45 PM
Master and slave database size difference
when I run this to compare:
select table_schema as 'Database Name', sum( data_length + index_length ) / 1024 / 1024 as 'Database Size in MB', sum( data_free )/ 1024 / 1024 as ‘Free Space in MB’ from information_schema.tables group by table_schema;
Some of the dbs on the slave are smaller by several megabytes. Is this common?
June 28th, 2013, 08:20 AM
a little more info... After some server updates a few weeks ago, I saw a replication error (I hadn't looked in a while - I know, bad me), so I took a dump of the master db and used that to recreate the slave before resetting and restarting replication. There have been no replication errors since. As such, I imagine that the data is the same in both. Since there are continual inserts, updates, etc., I can't really use checksums or hashes to compare the data files. Even one second difference would cause the checks not to match.
Is there a better way to check whether the data in both dbs is the same?