title: MySQL row Hashing
body: <p>I'm working on a database system where is one master bd &amp; table and many slaves, and the sales need to synchronize their data from the master.</p>
  
  <p>Some points about this arrangement:
  1) the slave db(S) will be offline from time to time, so when they get up again, the service will "sync" them. (So no replication)
  2) I can't change the master db, so not triggers. (imagine the master db to not belong to me)
  3) The sync will happen in a service and speed is not important.
  4) There is not massive amounts of data - so I could even walk though each row.
  5) The data in the rows varies wildly, from varchar(3) to varchar(500)</p>
  
  <p>I was looking around and found Md5() - this i thought was great, because then i could just CONCACT() the row values, and row-for-row compare. The problem i found was that CONCAT (AND GROUP_CONCAT) is a little limiting, in that it has a character limit.</p>
  
  <p>What's the best way to get a "row" CHECKSUM or HASH?</p>
  
  <p>CHECKSUM ROW WHERE id = 1 would be great... whats the closest to this?</p>
  
  <p><strong>UPDATE:</strong>
  I have managed to get to that "SELECT @@group_concat_max_len;" returns the max (4294967295). But this code still does not work:</p>
  
  <pre><code>SELECT id, MD5(GROUP_CONCAT(MD5(`id`), ...many columns here... ,MD5(`col30`))) AS 'md5Hash' FROM company_table GROUP BY id;
  </code></pre>
  
  <p>It still only works on a handful of columns.</p>