Hi all, I have a thorny problem and I hope this is the right place, I've been everywhere else I could think of. I have limited skills in this area.
I have a site with content management run by mysql/php (just to be original), using two databases on the same machine. db1 is the working copy for users to edit the site, db2 is the live db that runs the site. I need to be able to copy db1.table_n to db2.table_n on demand as and when the data is checked for integrity. The following statements are what I think I know. Please correct me if I'm horrendously wrong here: REPLACE INTO db2.table_n SELECT * FROM db1.table_n won't work as this won't delete empty rows from db2 (if a row gets deleted from db1 the change won't be reflected in db2). DELETE * from db2.table_n, then INSERT INTO db2.table_n SELECT * FROM db1.table_n looks like a very bad thing, although this *is* doing what I want to happen I just can't believe that's the correct way of doing things. BACKUP TABLE db1.table_n TO '/path/to/db2/directory' wouldn't recreate indexes and is probably a stupid idea anyway. Replication is no good as the data is synch'ed automatically without user intervention. If I could "trigger" replication this would be an option for me. mysqldump --opt -t -u myuser -pmypass db1 | mysql --host=localhost db2 looks good to me, but is way above my skill level and frankly I'm scared to run it. So my question boils down to... am I misusing REPLACE when in fact it would do the job, or will the mysqldump command work? Thanks, and if I'm in the wrong place please steer me in the right direction, cheers, Jaz ****************************** Jaz-Michael King Online Services Manager IPRO http://www.ipro.org ****************************** --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php