当以--log-update=file_name选项启动时,mysqld将所有更新数据的SQL命令写入记录文件中,如果对改日志文件进行操作是否可实现增量备份的功能?
解决方案 »
- MySQL FROM_UNIXTIME和UNIX_TIMESTAMP
- MySQL是否适合放于20TB的服务器中进行数据管理
- 如何进行 MYSQL 监控(性能,查询状态)----分不多,求指导
- 如何能显示数据库最近执行操作的SQL脚本?
- mysql 新建用户不能登录
- 最简单的sql问题
- 如何将服务器a里mysql的所有数据导道服务器b中?
- 请问 sql 怎样 查询最接近某一值的3条数据?急急急
- bat文件中mysqldump -uroot -p test>a.sql 执行时为什么会自动在test 后加一个1
- 虚心请教,
- 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.