Hi, Am 02.09.2009 02:00, schrieb none:
I have 2 MySQL servers in 2 different data centers. Between them, there is data replication setup.Is there a python tool so I can do data comparison for daily records?
Why should the data differ and the replication not detect and correct it? I frequently hear that MySQL has such a sophisticated replication...
Basically, just access both servers and do a diff in memory and print out records.
I'd not do this in memory since any database of resonably size can quickly have more then your work mem data in a table and in this case you would have it twice. You could start with connections to both databases and select * from table order by [primary keys or all columns] and then use difflib.SequenceMatcher on both cursors (they should be iterable) keep in mind that depending on your replication type the databases could differ by the exact time you start your comparison. Regards Tino
smime.p7s
Description: S/MIME Cryptographic Signature
-- http://mail.python.org/mailman/listinfo/python-list