Mysql官方文档翻译系列14.18--MySql备份与恢复
原文链接:
(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备份与恢复的更多相关文章
- 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 ...
- MySQL并发复制系列三:MySQL和MariaDB实现对比
http://blog.itpub.net/28218939/viewspace-1975856/ 并发复制(Parallel Replication) 系列三:MySQL 5.7 和MariaDB ...
- Mysql学习总结(14)——Mysql主从复制配置
mysql主从复制 怎么安装mysql数据库,这里不说了,只说它的主从复制,步骤如下: 1.主从服务器分别作以下操作: 1.1.版本一致 1.2.初始化表,并在后台启动mysql 1.3. ...
- mysql 开发基础系列14 字符集
字符集是一套文字符号及其编码,比较规则的集合.第一个字符集是ascll(american standard code for information interchange). 1. 选择合适的字 ...
- solr官方文档翻译系列之schema.xml配置介绍
常见的元素 <field name="weight" type="float" indexed="true" stored=" ...
- 【目录】mysql 基础篇系列
随笔分类 - mysql 基础篇系列 mysql 开发基础系列22 SQL Model(带迁移事项) 摘要: 一.概述 与其它数据库不同,mysql 可以运行不同的sql model 下, sql m ...
- MySQL高性能优化系列-目录
MySQL高性能优化系列-目录 (1)Mysql高性能优化规范建议 (2)电商数据库表设计 (3)MySQL分区表使用方法 (4)MySQL执行计划分析 (5)电商场景下的常见业务SQL处理 (6)M ...
- 初学mysql 如何删除数据库 如何安装mysql
廖老师官网链接 这两个表格有个映射关系,就是根据Grade_ID可以在班级表中查找到对应的所有班级: 也就是Grade表的每一行对应Class表的多行,在关系数据库中,这种基于表(Table)的一对多 ...
- Mysql高手系列 - 第18篇:mysql流程控制语句详解(高手进阶)
Mysql系列的目标是:通过这个系列从入门到全面掌握一个高级开发所需要的全部技能. 这是Mysql系列第18篇. 环境:mysql5.7.25,cmd命令中进行演示. 代码中被[]包含的表示可选,|符 ...
随机推荐
- 设计模式——抽象工厂模式(C++实现)
#include <iostream> #include <string> using namespace std; class STAbstractProductA { pu ...
- 用js写动态时钟 2017-03-23
45每隔1秒变一次: 代码如下: <body onLoad="show()" > ------------表示当页面载入时执行该事件,可以没有 <div id ...
- 简单docker镜像修改方式
• 创建Dockerfile,文件内容如下: FROM nps:v1.0.1 ENTRYPOINT ["/usr/bin/init.sh"] • 启动基础镜像:docker run ...
- mybatis返回list
1 Model类 public class Vo { /** * this is used for receive data partly from table user_question_secti ...
- java排序算法(五):快速排序
java排序算法(五):快速排序 快速排序是一个速度非常快的交换排序算法,它的基本思路很简单,从待排的数据序列中任取一个数据(如第一个数据)作为分界值,所有比它小的元素放到左边.所有比它大的元素放到右 ...
- VS2017调试器无法附加到IIS进程(w3wp.exe)
问题描述: 当使用VS2017-> 调试->附加到进程来调试IIS进程(w3wp.exe)时,报错"无法附加到进程,已附加了一个调试器" 为了解决这个问题花了不少时间, ...
- 第二次作业--------STEAM
--------------------------------------第一部分 产品介绍----------------------------------------------------- ...
- 阿尔法冲刺——Postmortem会议
设想与目标 1.我们软件要解决什么问题?是否定义得很清楚?是否对典型用户和典型场景有清晰的描述? 这个问题,我们觉得我们的软件目标还是比较明确的,在SRS中也给出了典型用户和典型场景的清晰的描述. 2 ...
- 四则运算----C++版
一.设计思想 因java中已做过,就是简单的将java中的语句调换为C++的语句. 二.代码 #include<iostream.h> #include<Stdlib.h> v ...
- iOS开发点滴-添加阴影效果
UIBezierPath *shadowPath = [UIBezierPath bezierPathWithRect:_backView.bounds]; _backView.layer.masks ...