I am familiar with mysqlbinlog that is used to process the binary log to
produce a text file that can then be feed back into mysql. That appears
to be what you are referring to.

But I'm not referring to the binary log, or any derivative of it, at
all. I am referring to the actual general query log.

Does anyone know of a utility that will processes the general query log
(not the binary log or the binary log text file from mysqlbinlog) to
rerun the queries?

The program would need to...

...strip file header information
...strip the leading non query info from the line
...handle queries that span multiple lines
...change databases when appropriate before queries
...add the ; to the end of the query

an option to only reprocess unique queries might also be nice.

has anyone already done this?

daniel

-----Original Message-----
From: Daniel Kasak [mailto:[EMAIL PROTECTED] 
Sent: Monday, January 10, 2005 8:55 PM
To: Daniel Gaddis; mysql@lists.mysql.com
Subject: Re: does anyone know of a utility that will processes the query
log to rerun the queries?

Yes. The mysql client is good for this.
I used to restore from disasters this way, eg:

- full backup every night
- transaction log ( the text one, not the binary one ) gets reset each 
night by restarting mysql after the backup

Then when our disaster happened, we'd drop all databases, import from 
last night's backups, and then run the transaction log:

mysql < /path/to/transaction/log -p

Unfortunately this becomes a little more complicated if you use 
temporary tables ... especially if you're updating the DB from the 
contents of the temporary tables, as the recovery process will run as 1 
user instead of all the original users that ran it to start with. I 
believe the binary transaction log is good in this case, but I haven't 
bothered to check up on how to use it yet.

But if you don't create temporary tables, then the above 1-liner should
do.

Dan


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to