In case of an operating system crash or power failure, 在操作系统崩溃或电源故障的情况下,InnoDB
itself does all the job of recovering data. But to make sure that you can sleep well, observe the following guidelines:InnoDB
本身会完成恢复数据的所有工作。但为了确保你能睡得好,请遵守以下准则:
Always tun the MySQL server with binary logging enabled (that is the default setting for MySQL 8.0). If you have such safe media, this technique can also be good for disk load balancing (which results in a performance improvement).始终在MySQL服务器上启用二进制日志记录(这是MySQL 8.0的默认设置)。如果你有这样的安全介质,这种技术也有利于磁盘负载平衡(从而提高性能)。
Make periodic full backups, using the mysqldump command shown earlier in Section 7.3.1, “Establishing a Backup Policy”, that makes an online, nonblocking backup.使用前面第7.3.1节,“建立备份策略”中显示的mysqldump命令进行定期完整备份,该命令可进行在线非阻塞备份。
Make periodic incremental backups by flushing the logs with 通过使用FLUSH LOGS
or mysqladmin flush-logs.FLUSH LOGS
或mysqladmin刷新日志刷新日志来进行定期增量备份。