MySQL Forums
Forum List  »  Backup

Re: Does this on-line backup strategy work?
Posted by: Guilhem Bichot
Date: May 06, 2005 02:52AM

Hello,
As you said there is the problem of getting the backup and the log flush at the same time. I suggest using 4.1 and doing:
mysqldump --user=root --password=whatever --single-transaction --verbose --delete-master-logs repository --result-file=D:\MySQLDataBackups\Repository\Repository.sql

Then at restore,
<shut down server>
<save the binary log files>
<start server with network turned off>
drop database repository
create database repository
mysql --user=root --password=whatever -e "source D:\MySQLDataBackups\Repository\Repository.sql"
mysqlbinlog --disable-log-bin <all the saved binary log files> | mysql etc
<shut down server>
<start server with network turned on>

--disable-log-bin is to avoid that you recreate binary logs during restore (if you don't use it, you'll fill new binlogs with statements contained in old binlogs you restore - well --disable-log-bin is just to save disk space, not critically needed - see "mysqlbinlog --help").
There are ways to avoid shutdowns/restarts, but restore is so rare that it's maybe not worth refining.

Mr. Guilhem Bichot <guilhem@mysql.com>
MySQL AB, Lead Software Engineer
Bordeaux, France
www.mysql.com

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Does this on-line backup strategy work?
3405
May 06, 2005 02:52AM


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.