原文链接:
(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. 数据操纵:SELECT, INSERT, UPDATE, DELETE

    SELECT 句法 SELECT [STRAIGHT_JOIN] [SQL_SMALL_RESULT] [SQL_BIG_RESULT] [SQL_BUFFER_RESULT] [SQL_CACHE ...

  2. 使用Angular CLI进行单元测试和E2E测试

    第一篇文章是: "使用angular cli生成angular5项目" : http://www.cnblogs.com/cgzl/p/8594571.html 第二篇文章是: & ...

  3. jquery ajax 返回的json对象 新增属性值(干货)

    $.ajax({ type:"GEt'; url:"你的地址", data:{"你的字段","字段值"} success:funt ...

  4. Algorithm --> 求1到n的和

    求1到n的和 输入n,求和1到n,要求不能使用乘除法,不使用任何if while for 以及三目运算,怎么做? 版本一 static int f(int n) { n && (n + ...

  5. Algorithm --> 全排列

    1.算法简述 简单地说:全排列就是从第一个数字起每个数分别与它后面的数字交换. E.g:E = (a , b , c),则 prem(E)= a.perm(b,c)+ b.perm(a,c)+ c.p ...

  6. windows上SSH服务连接远程主机失败

    putty连接出现错误提示"Network error:connection refused",xshell连接出现错误提示"connection failed:(por ...

  7. ASP.NET Core MVC 2.1 顶级参数验证

    本文讨论ASP.NET Core 2.1中与ASP.NET Core MVC / Web API控制器中的模型绑定相关的功能.虽说这是一个功能,但从我的角度来看,它更像是一个错误修复! 请注意,我使用 ...

  8. jquery datatable ajax配置详解

    我写的这个东西类似于个人笔记,如果你想要完整的而了解 可以去这里看看 http://dt.thxopen.com/ 包括英文原网站都不错. 通过配置ajax的属性和服务器交互 $("sele ...

  9. 关于css的text-indent首行缩进两个字符和图片缩进的问题

    段落前面空两个字的距离,不要再使用空格了.应该使用首行缩进text-indent. text-indent可以使得容器内首行缩进一定单位.比如中文段落一般每段前空两个汉字. <style typ ...

  10. New UWP Community Toolkit - RadialProgressBar

    概述 UWP Community Toolkit  中有一个圆形的进度条控件 - RadialProgressBar,本篇我们结合代码详细讲解  RadialProgressBar 的实现. Radi ...