原文链接:
(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. 软件测试第二周作业 WordCount

    本人github地址:  https://github.com/wenthehandsome23 psp阶段 预估耗时 (分钟) 实际耗时 (分钟) 计划 30 10 估计这个任务需要多少时间 20 ...

  2. 深入浅出了解OCR识别票据原理(Applying OCR Technology for Receipt Recognition)

    原文:Applying OCR Technology for Receipt Recognition 译文:深入浅出了解OCR识别票据原理 英文票据识别技术, 非中文票据识别技术, 中文情况的ocr更 ...

  3. LinkedList源码解析(JDK1.8)

    package java.util; import java.util.function.Consumer; /** * LinkedList是List和Deque接口的双向链表的实现.实现了所有可选 ...

  4. 【数据库】MySQL中的共享锁与排他锁

    转载:http://www.hollischuang.com/archives/923 在MySQL中的行级锁,表级锁,页级锁中介绍过,行级锁是Mysql中锁定粒度最细的一种锁,行级锁能大大减少数据库 ...

  5. 记录一则ASM实例阻塞,rbal进程异常的案例

    1.故障现象描述 2.确认故障现象 3.排查ASM层面 4.解决问题 1.故障现象描述 环境:AIX 7.1 + Standalone Oracle 11.2.0.4 现象:客户反映某11g版本的AD ...

  6. 获取请求主机IP地址,如果通过代理进来,则透过防火墙获取真实IP地址;

    package com.utils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import javax.servlet.htt ...

  7. ReflectASM-invoke,高效率java反射机制原理

    前言:前段时间在设计公司基于netty的易用框架时,很多地方都用到了反射机制.反射的性能一直是大家有目共睹的诟病,相比于直接调用速度上差了很多.但是在很多地方,作为未知通用判断的时候,不得不调用反射类 ...

  8. selenium +python+windows 环境搭建

    很久不弄selenium了,好怀念,现在搭建下环境 1,先安装pip ,因为装的是python3,所以只要你不是在渣渣网站下载到坏的版本,在scripts目录下都有pip.exe文件 直接在环境变量里 ...

  9. JSON字符串转为JSON对象

    在数据传输流程中,json是以文本,即字符串的形式传递的,而JS操作的是对象,所以,JSON对象(js对象)和JSON字符串之间的相互转换是关键. JSON可以有两种格式,一种是对象格式的,另一种是数 ...

  10. spring学习笔记一 入门及配置

    Spring是一个开源框架,为了解决企业应用开发的复杂性而创建的.主要优势之一就是其分层架构.Spring的核心是控制反转和面向切面.简单来说,Spring是一个分层的一站式轻量级开源框架. 使用Sp ...