[Linux-disciples] Replaying MySQL commands

Adam Rosi-Kessel adam at rosi-kessel.org
Fri Apr 21 12:24:14 EDT 2006


Can't you just redirect from the file?

mysql [switches] < logfile.sql

This is what I've done in the past to move entire databases

mysqldump [stuff] > logfile
mysql [stuff] < logfile

Stephen R Laniel wrote:
> I've got a bunch of SQL commands, recorded from a live (and
> very busy) website using the MySQL logging commands. Now I
> want to replay them on a local website. What's the best way
> to do that? There must be some good way to script such
> things.
> 
> I mean, I could do
> 
> mysql -u [username] --password=[password] [databaseName] "[command]"
> 
> for each [command] in the logfile, but there has to be a
> better way. Particularly since the logfile marks off
> database connections, and I'd like all the commands that
> were executed in separate connections to be replayed
> in separate connections.
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Linux-disciples mailing list
> Linux-disciples at lists.bostoncoop.net
> http://lists.bostoncoop.net/mailman/listinfo/linux-disciples


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 250 bytes
Desc: OpenPGP digital signature
Url : http://lists.bostoncoop.net/pipermail/linux-disciples/attachments/20060421/42210ad3/signature.pgp


More information about the Linux-disciples mailing list