当以--log-update=file_name选项启动时,mysqld将所有更新数据的SQL命令写入记录文件中,如果对改日志文件进行操作是否可实现增量备份的功能?
解决方案 »
- 请问这句话使用POSTGRES如何实现?
- 超级简单的一个触发器怎么总是报错,帮忙看看
- mysql数据恢复,【加急】。。。
- 请教关于一个mysql转义字符的问题
- 这是怎么一回事啊?为什么我这台电脑连数据库很慢啊
- 百分求一句SQL简单的语句,年纪大了,想半天也想不起来怎么弄
- freebsd系统下postgresql数据中出现的问题
- 求将文件上传时把文件转换成byte[]的代码
- 紧急求助PHP+mysql问题
- 做MySQL的前途如何?
- not allowed to connect to this MySQL,怎么解决啊?
- 不好意思极菜的问题,有没有能告诉我sql server 和my sql 有什么区别
`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.