MySQL Forums
Forum List  »  InnoDB

Re: Importing a database dump created with --single-transaction does not result in single-transaction import of the file
Posted by: Rick James
Date: February 13, 2013 09:52PM

Don't empty the table you want to keep available...

1. CREATE NewTable LIKE Table; (or use a real CREATE statement)
2. Load data (by whatever means) into NewTable.
3. RENAME TABLE Table TO OldTable, NewTable TO Table;
4. DROP TABLE OldTable; (now, or later)

The loading does not need any "transaction".
No, mysqldump cannot do the RENAME game. A simple shell/bat script could do it.
The RENAME is 'atomic' and 'instantaneous' (regardless of table size), so the users will be oblivious to it.
The only slow step is #2, and it does not matter how long it takes.

Options: ReplyQuote




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.