Mathieu Bruneau <[EMAIL PROTECTED]> wrote:
> Ofer Inbar a écrit :
> > I can repeat the problem with this procedure on the test db:
> > - Import a full mysqldump file from the prodution db
> > - flush logs
> > - run a full mysqldump with --flush-logs --master-data=2
> > - do a bunch of stuff that writes data
> > - drop the database, and recreate it, flushing the log
> > - make a copy of the binary log made since the mysqldump
> > - import the mysqldump I made locally
> > => now I have all data correctly restored up to that point
> >
> > Now, I attempt to restore the binary log and this happens:
> >
> > mysqlbinlog [binlogfile] | mysql -u root -p[db root password] [db name]
> > ERROR 1062 (23000) at line 21: Duplicate entry '16021330' for key 1
> I think your problem is in the way your trying to playback the binlog.
> I guess this is happening when you try to play the first of your binlog
> right ?
There is only one relevant binlog in the scenario I describe.
So yes, it is the "first" :)
> Using mysqlbinlog in the way you put it will replay all the log but you
> are probably somewhere in the middle of that log (Or maybe that binlog
> is already inside your backup) Since you dumped with --master-data=2
Either I am misunderstanding something very basic, or you
misunderstood my scenario, so let's clarify:
If I run a mysqldump with the --flush-logs option, and I see that
mysql did indeed start a new binlog at the moment I ran mysqlbindump,
am I not guaranteed that the the new binlog starts *after* the dump
and that I should replay from the beginning of that log?
-- Cos (Ofer Inbar) -- [EMAIL PROTECTED]
"This may seem a bit weird, but that's okay, because it is weird."
-- Larry Wall in perlref(1) man page, Perl 5.001
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]