MySQL Forums
Forum List  »  Backup

Re: Merge two MySQL databases?
Posted by: Guilhem Bichot
Date: May 06, 2005 02:32AM

1) to ensure that you don't lose data in case of crash, put your tables into the InnoDB storage engine instead (I guess you are using the default storage engine: MyISAM); it is transactional and has crash recovery capabilities - very robust.
2) As for merging: I'd suggest:
- restore the old .sql backup
- modify the recent but incomplete .sql: make sure that it does not contain some DROP TABLES or DROP DATABASE, change all INSERT to REPLACE, and restore it

IF every row of every table has a unique key,
then the REPLACE will replace each row by its new version if it exists.

But it's always dangerous to do something so uncertain with your data without knowing. I urge you to read the MySQL manual, it's not that long, and you can skip sections which are not critically needed:

Mr. Guilhem Bichot <>
MySQL AB, Lead Software Engineer
Bordeaux, France

Options: ReplyQuote

Written By
May 01, 2005 08:25AM
Re: Merge two MySQL databases?
May 06, 2005 02:32AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.