Table of Contents
It is important to back up your databases so that you can recover your data and be up and running again in case problems occur, such as system crashes, hardware failures, or users deleting data by mistake. 备份数据库非常重要,这样在出现问题(如系统崩溃、硬件故障或用户错误删除数据)时,您就可以恢复数据并重新启动和运行。Backups are also essential as a safeguard before upgrading a MySQL installation, and they can be used to transfer a MySQL installation to another system or to set up replica servers.备份在升级MySQL安装之前也是必不可少的保护措施,它们可以用于将MySQL安装转移到另一个系统或设置副本服务器。
MySQL offers a variety of backup strategies from which you can choose the methods that best suit the requirements for your installation. This chapter discusses several backup and recovery topics with which you should be familiar:MySQL提供了多种备份策略,您可以从中选择最适合安装要求的方法。本章讨论了您应该熟悉的几个备份和恢复主题:
Types of backups: Logical versus physical, full versus incremental, and so forth.备份类型:逻辑备份与物理备份、完全备份与增量备份等等。
Methods for creating backups.创建备份的方法。
Recovery methods, including point-in-time recovery.恢复方法,包括时间点恢复。
Backup scheduling, compression, and encryption.备份计划、压缩和加密。
Table maintenance, to enable recovery of corrupt tables.表维护,以恢复损坏的表。
Resources related to backup or to maintaining data availability include the following:与备份或维护数据可用性相关的资源包括以下内容:
Customers of MySQL Enterprise Edition can use the MySQL Enterprise Backup product for backups. MySQL Enterprise Edition的客户可以使用MySQL Enterprise Backup产品进行备份。For an overview of the MySQL Enterprise Backup product, see Section 30.2, “MySQL Enterprise Backup Overview”.有关MySQL企业备份产品的概述,请参阅第30.2节,“MySQL企业备份概述”。
A forum dedicated to backup issues is available at https://forums.mysql.com/list.php?28.专门讨论备份问题的论坛位于https://forums.mysql.com/list.php?28。
Details for mysqldump can be found in Chapter 4, MySQL Programs.mysqldump的详细信息可以在第4章,“MySQL程序”中找到。
The syntax of the SQL statements described here is given in Chapter 13, SQL Statements.这里描述的SQL语句的语法在第13章,“SQL语句”中给出。
For additional information about 有关InnoDB
backup procedures, see Section 15.18.1, “InnoDB Backup”.InnoDB
备份程序的更多信息,请参阅第15.18.1节,“InnoDB备份”。
Replication enables you to maintain identical data on multiple servers. This has several benefits, such as enabling client query load to be distributed over servers, availability of data even if a given server is taken offline or fails, and the ability to make backups with no impact on the source by using a replica. 复制使您能够在多台服务器上维护相同的数据。这有几个好处,例如使客户端查询负载能够分布在服务器上,即使给定的服务器离线或出现故障也能获得数据,以及能够通过使用副本在不影响源的情况下进行备份。See Chapter 17, Replication.请参阅第17章,“复制”。
MySQL InnoDB Cluster is a collection of products that work together to provide a high availability solution. MySQL InnoDB
集群是一个产品集合,它们协同工作以提供高可用性解决方案。A group of MySQL servers can be configured to create a cluster using MySQL Shell. The cluster of servers has a single source, called the primary, which acts as the read-write source. 一组MySQL服务器可以配置为使用MySQL Shell创建集群。服务器集群有一个称为primary的单一源,它充当读写源。Multiple secondary servers are replicas of the source. A minimum of three servers are required to create a high availability cluster. A client application is connected to the primary via MySQL Router. If the primary fails, a secondary is automatically promoted to the role of primary, and MySQL Router routes requests to the new primary.多个辅助服务器是源的副本。创建一个高可用性集群至少需要三台服务器。客户端应用程序通过MySQL路由器连接到主应用程序。如果主服务器失败,辅助服务器会自动升级为主服务器,MySQL路由器会将请求路由到新的主服务器。
NDB Cluster provides a high-availability, high-redundancy version of MySQL adapted for the distributed computing environment. NDB Cluster提供了适用于分布式计算环境的高可用性、高冗余版本的MySQL。See Chapter 23, MySQL NDB Cluster 8.0, which provides information about MySQL NDB Cluster 8.0.请参阅第23章,“MySQL NDB Cluster 8.0”,其中提供了有关MySQL NDB Cluster 8.0的信息。