原文链接:
(https://dev.mysql.com/doc/refman/5.7/en/innodb-backup-recovery.html)

The key to safe database management is making regular backups. Depending on your data volume, number of MySQL servers, and database workload, you can use these backup techniques, alone or in combination: hot backup with MySQL Enterprise Backup; cold backup by copying files while the MySQL server is shut down; logical backup with mysqldump for smaller data volumes or to record the structure of schema objects. Hot and cold backups are physical backups that copy actual data files, which can be used directly by the mysqld server for faster restore.

数据库安全管理的关键是进行常规备份。根据你的数据量,数据库服务器的个数以及数据库的工作负荷,你能使用单独或者组合使用以下这些备份技术:
Mysql企业版热备份;通过当Mysql服务器关闭时拷贝文件进行的冷备份;针对小数据量或者记录记录数据库模式结构而采用mysqldump进行逻辑备份。
热备和冷备都是拷贝通过拷贝实际的数据文件进行物理备份,这些文件能够直接被mysqld服务器使用以进行快速恢复。

> 热备份

The mysqlbackup command, part of the MySQL Enterprise Backup component, lets you back up a running MySQL instance, including InnoDB tables, with minimal disruption to operations while producing a consistent snapshot of the database. When mysqlbackup is copying InnoDB tables, reads and writes to InnoDB tables can continue. MySQL Enterprise Backup can also create compressed backup files, and back up subsets of tables and databases. In conjunction with the MySQL binary log, users can perform point-in-time recovery. MySQL Enterprise Backup is part of the MySQL Enterprise subscription. For more details, see Section 29.2, “MySQL Enterprise Backup Overview”.

mysqlbackup命令是MySQL企业版备份模块的一部分,可以让你备份一个运行中的MySQL实例,包括InnoDB表,而且在生成一个一致性的数据库快照时能够最少地中断业务操作。
当mysqlbackup拷贝InnoDB表时,对InnoDB的读和写操作能够继续进行。Mysql企业版备份功能同样可以创建压缩的备份文件,备份表和数据库的子集。协同Mysql二进制日志,用户能够进行时间点级别的恢复。
Mysql企业版备份功能时Mysql企业版的一部分。更多细节参考MySQL Enterprise Backup Overview.

> 冷备份

If you can shut down the MySQL server, you can make a physical backup that consists of all files used by InnoDB to manage its tables. Use the following procedure:
Perform a slow shutdown of the MySQL server and make sure that it stops without errors.
Copy all InnoDB data files (ibdata files and .ibd files) into a safe place.
Copy all the .frm files for InnoDB tables to a safe place.
Copy all InnoDB log files (ib_logfile files) to a safe place.
Copy your my.cnf configuration file or files to a safe place.

如果你关闭Mysql服务器,你能将Innodb管理表过程用到的所有文件进行物理备份。进行如下步骤:

  • 正常关闭mysql服务器,确保没有错误.
  • 拷贝所有innodb数据文件(ibdata和.ibd文件)到一个安全的地方.
  • 拷贝所有innodb表用到的.frm文件到一个安全的地方。
  • 拷贝所有innodb的日志文件(ib_logfile)到一个安全的地方。
  • 拷贝你的my.cnf配置文件到一个安全的地方。

> 用mysqldump进行逻辑备份

In addition to physical backups, it is recommended that you regularly create logical backups by dumping your tables using mysqldump. A binary file might be corrupted without you noticing it. Dumped tables are stored into text files that are human-readable, so spotting table corruption becomes easier. Also, because the format is simpler, the chance for serious data corruption is smaller. mysqldump also has a --single-transaction option for making a consistent snapshot without locking out other clients. See Section 7.3.1, “Establishing a Backup Policy”.
Replication works with InnoDB tables, so you can use MySQL replication capabilities to keep a copy of your database at database sites requiring high availability. See Section 14.19, “InnoDB and MySQL Replication”.

除了物理备份,也推荐你定期地通过mysqldump来转储表文件来创建逻辑备份。二进制文件稍不留神就会崩溃。转储的表被存储进人类刻度的文本文件中,因此找出表中的崩溃点更容易。而且,因为格式简单,严重的数据损坏的几率更小。
mysqldump有--single-transaction选项来使得导出一致性快照时不锁定其他客户端。参考章节7.31.1,Establishing a Backup Policy
Innodb表在主备复制中可以工作,因此你可以使用mysql复制特性来保存一个数据库的备份来保证高可用。参考章节14.19,“InnoDB and MySQL Replication”

Mysql官方文档翻译系列14.18--MySql备份与恢复的更多相关文章

  1. Mysql官方文档翻译系列-7.3.1 Establishing a Backup Policy

    原文链接 (https://dev.mysql.com/doc/refman/5.7/en/backup-policy.html) 正文 To be useful, backups must be s ...

  2. MySQL并发复制系列三:MySQL和MariaDB实现对比

    http://blog.itpub.net/28218939/viewspace-1975856/ 并发复制(Parallel Replication) 系列三:MySQL 5.7 和MariaDB ...

  3. Mysql学习总结(14)——Mysql主从复制配置

    mysql主从复制 怎么安装mysql数据库,这里不说了,只说它的主从复制,步骤如下: 1.主从服务器分别作以下操作:   1.1.版本一致   1.2.初始化表,并在后台启动mysql   1.3. ...

  4. mysql 开发基础系列14 字符集

    字符集是一套文字符号及其编码,比较规则的集合.第一个字符集是ascll(american standard code for information interchange).  1.  选择合适的字 ...

  5. solr官方文档翻译系列之schema.xml配置介绍

    常见的元素 <field name="weight" type="float" indexed="true" stored=" ...

  6. 【目录】mysql 基础篇系列

    随笔分类 - mysql 基础篇系列 mysql 开发基础系列22 SQL Model(带迁移事项) 摘要: 一.概述 与其它数据库不同,mysql 可以运行不同的sql model 下, sql m ...

  7. MySQL高性能优化系列-目录

    MySQL高性能优化系列-目录 (1)Mysql高性能优化规范建议 (2)电商数据库表设计 (3)MySQL分区表使用方法 (4)MySQL执行计划分析 (5)电商场景下的常见业务SQL处理 (6)M ...

  8. 初学mysql 如何删除数据库 如何安装mysql

    廖老师官网链接 这两个表格有个映射关系,就是根据Grade_ID可以在班级表中查找到对应的所有班级: 也就是Grade表的每一行对应Class表的多行,在关系数据库中,这种基于表(Table)的一对多 ...

  9. Mysql高手系列 - 第18篇:mysql流程控制语句详解(高手进阶)

    Mysql系列的目标是:通过这个系列从入门到全面掌握一个高级开发所需要的全部技能. 这是Mysql系列第18篇. 环境:mysql5.7.25,cmd命令中进行演示. 代码中被[]包含的表示可选,|符 ...

随机推荐

  1. CentOS 7主机名的弯弯绕绕

    在CentOS 6中,修改主机名方式很简单,临时修改主机名使用hostname命令,永久修改主机名直接写进文件/etc/sysconfig/network中即可. 但在CentOS 7中,主机名就没那 ...

  2. 关于ASP.NET MVC的js和css资源管理

    本文来源于博客园-钱智慧,转载请注明出处 通过这篇文章和这个回答,我们总结如下: 浏览器针对一个域名,最多只会开启6个线程来加载文件,比如head中如果有7个引入文件(js文件或者css文件)的标签, ...

  3. 使用Intellij IDEA生成JavaDoc

    以下是常用的注释标签,规范书写生成的文档中才能显示: @author 作者 @version 版本 @see 参考转向 @param 参数说明 @return 返回值说明 @exception 异常说 ...

  4. Http最常见的错误代码

    1XX 表示消息 2XX 表示成功 3XX 表示重定向 4XX 表示请求错误 5XX 表示服务器端错误 我们最常见的就是: 404(页面找不到),这个错误代码是由于我们输入的网址不对造成的,浏览器找不 ...

  5. 排序算法Java实现(基数排序)

    算法思想:依次按个位.十位...来排序,每一个pos都有分配过程和收集过程,array[i][0]记录第i行数据的个数. package sorting; /** * 基数排序 * 平均O(d(n+r ...

  6. poj-3660-cows contest(不懂待定)

    Description N (1 ≤ N ≤ 100) cows, conveniently numbered 1..N, are participating in a programming con ...

  7. 【CSS】 CSS 定位

    css 定位和浮动 *******本章大量内容copy自w3school********* 定位对于html界面还是很重要的,因为定位会直接影响到用户的视图.对于css而言,定位也比较灵活. 浮动是一 ...

  8. 【Python】 http客户端库requests & urllib2 以及ip地址处理IPy

    requests requests是个HTTPClient库,相比于urllib,urllib2等模块比更加简洁易用 ■ get请求 作为示例,讲一下关于requests如何发起并处理一个get请求 ...

  9. 痛吻过YY寻找到真爱的三非渣本春招之路

    写下这篇文章可能就不是大家乐于见闻的面经了,更多是深入一些面试细节. 前言 我猜拿到了BAT等一线互联网公司Offer的小伙伴或者那些老鸟看到这条标题的时候会不屑一顾,认为YY这种级别的公司是属于二线 ...

  10. JavaScript Alert 函数执行顺序问题

    * { color: #3e3e3e } body { font-family: "Helvetica Neue", Helvetica, "Hiragino Sans ...