Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Re: Proper way to re-sync

From: Paul Sindelar <paul.lists(at)mnwebhost.net>
Date: Mon Oct 01 2007 - 23:59:42 EDT


Check out the MySQL Toolkit. http://sourceforge.net/projects/mysqltoolkit

It contains a table-sync tool. AFAIK, the current version only works if all your tables have primary keys (unique keys don't count, must be primary). It also has a tool for verifying the integrity of your slaves. The author of the program gave me another idea too for syncing tables, he said "if you have to resync a table without a primary key, you might consider locking the table on the master, running SELECT INTO OUTFILE, running TRUNCATE, and running LOAD DATA INFILE -- all on the master. If you know which rows are bad, you can do DELETE or REPLACE on those specific rows on the master to put statements into the binlog that won't affect anything on the master, but will affect the slave."

Good luck!
-Paul

Jesse wrote:
> When the databases get out of sync during replication, what is the
> best way to re-sync them on a Windows system? The only way I know of
> right now is to do it late at night, and pray that no one gets in
> while you're doing it. Stop the slave, do a backup (using MySQL
> Administrator, or mysqldump), note the log position on the master,
> restore the data on the slave, change the log position on the slave,
> then re-start the slave. Is this the best way to do it?
>
> My issue has always been that I need the master MySQL running all the
> time. I might be able to stop it for a minute or two, and I'm sure
> that'll generate errors, but what can I do. But, in order to run a
> backup, it needs to be running. I've tried the "copy the physical
> files" thing, and that has never worked for me. Don't know why, but it
> doesn't.
>
> Any ideas?
>
> Thanks,
> Jesse
>
>

-- 
MySQL Replication Mailing List
For list archives: 
http://lists.mysql.com/replication
To unsubscribe:    
http://lists.mysql.com/replication?unsub=lists@pantek.com
Received on Mon Oct 1 23:59:52 2007

This archive was generated by hypermail 2.1.8 : Sun Oct 07 2007 - 10:14:25 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library