If you use the --log or -l options, mysqld writes a general log with a lename of `hostname.log', and restarts and refreshes do not cause a new log le to be generated (although it is closed and reopened). In this case you can copy it (on Unix) by doing: mv hostname.log hostname-old.log mysqladmin flush-logs cp hostname-old.log to-backup-directory rm hostname-old.log Update logging is smart because it logs only statements that really update data. So an UPDATE or a DELETE with a WHERE that nds no rows is not written to the log. It even skips UPDATE statements that set a column to the value it already has. The update logging is done immediately after a query completes but before any locks are released or any commit is done. This ensures that the log will be logged in the execution order. If you want to update a database from update log les, you could do the following (assuming your update logs have names of the form `file_name.###'): shell> ls -1 -t -r file_name.[0-9]* | xargs cat | mysql ls is used to get all the log les in the right order. This can be useful if you have to revert to backup les after a crash and you want to redo the updates that occurred between the time of the backup and the crash.
`hostname.log', and restarts and refreshes do not cause a new log le to be generated
(although it is closed and reopened). In this case you can copy it (on Unix) by doing:
mv hostname.log hostname-old.log
mysqladmin flush-logs
cp hostname-old.log to-backup-directory
rm hostname-old.log
Update logging is smart because it logs only statements that really update data. So an
UPDATE or a DELETE with a WHERE that nds no rows is not written to the log. It even skips
UPDATE statements that set a column to the value it already has.
The update logging is done immediately after a query completes but before any locks are
released or any commit is done. This ensures that the log will be logged in the execution
order.
If you want to update a database from update log les, you could do the following (assuming
your update logs have names of the form `file_name.###'):
shell> ls -1 -t -r file_name.[0-9]* | xargs cat | mysql
ls is used to get all the log les in the right order.
This can be useful if you have to revert to backup les after a crash and you want to redo
the updates that occurred between the time of the backup and the crash.