日志:

  错误日志: 主要用于记录服务器运行当中错误信息,服务器启动或者关闭过程中产生的信息,从服务器上启动中继服务进程所产生的信息,还有事件调度器启动的信息;

  一般查询日志: 任何一个查询语句所产生的日志信息都要记录下来,这可能信息量非常大,所以一般查询信息默认是关闭的,不到万不得已也不建议开启;

  慢查询日志: 一般查询日志和慢查询日志都是查询信息,只不过查询慢一点,超出long_query_time才算慢查询,慢查询可以启用慢查询日志以记录那些查询比较慢帮我们定位服务器性能问题的,执行查询的速度慢并不意味着这个查询本身慢,可能是因为其它资源被占用导致无法获取有效资源而无法执行查询,因为慢查询日志的评估是根据它从开始启动这个查询一直到查询结束这段时候,而不是真正在CPU上执行的时间,无论是一般查询日志还是慢查询日志他们都可以记录到文件中或者表中;

    log_output {TABLE|FILE|NONE} 定义查询日志记录类型,如果定义为NONE就算启用了查询日志它也不会记录,因为压根没有往任何地方输出,使用TABLE表示输出到表当中,保存到mysql库中的某一个表当中,自己要去建立这张表,FILE表示保存到指定的文件当中,TABLE和FILE可以同时指定用,逗号隔开就行,很多时候可能需要开启慢查询日志,因为慢查询日志执行的时间长度可以自己调整,可以在生产环境中评估一下慢查询到底算多长时间给它改一个long_query_time为你自己所需要的时间,而后通过分析慢查询日志,将来可以方便的定位服务器性能问题以实现服务器优化,比如对于某个查询语句进行优化或者查询语句执行速度的其它语句进行优化;

  二进制日志:

    复制、即时点恢复

    二进制日志事件:

      基于语句: statement

      基于行: row

      混合方式: mixed

    存放在数据目录: 一般建议不要跟数据目录放在同一个存储位置,因为每一次存储设备的I/O操作,每一次数据的写操作都会引起二进制日志的写操作,所以两者都会产生I/O,那也就意味着放在同一块磁盘上两个I/O会产生竞争的,所以这就本身会带来性能低下的状况,所以建议一定不要放同一块磁盘上,而且为了避免由于数据文件损坏,所在的设备损坏,也导致二进制日志文件损坏,所以尤其的建议应该分开存储,基于两个原因性能和数据可靠性的原因都应该分开存放;

    mysql> SHOW BINARY LOGS;(查看正在使用的二进制日志文件)

    mysql> SHOW MASTER STATUS;(查看当前正在使用的二进制日志文件)

    mysql> SHOW BINLOG EVENTS IN '二进制日志文件' FROM 'position';(查看某个二进制日志文件内容,position从某个时间位置开始)

    mysql> PURGE BINARY LOGS TO '二进制日志文件';(清除指定二进制日志文件以前的日志文件,不会清除当前指定的)

    mysql> FLUSH LOGS;(手动实现二进制日志滚动一次)

  mysqlbinlog (在shell下详细查看二进制日志文件内容)

    --start--position 起始位置

    --stop-position 结束位置

    --start-datetime 'yyyy-mm-dd hh:mm:ss' 起始时间

    --stop-datetime 'yyyy-mm-dd hh:mm:ss' 结束时间

    可以使用>输出重定向的方式将使用mysqlbinlog查看的二进制文件内容保存到文本文件中,而后使用此文本文件导入到数据库里面可以实现恢复数据的,因为它里面记录的都是具体的操作;

  中继日志:

    从主服务器的二进制日志文件中复制而来的事件,并保存为的日志文件;

  事务日志:

    事务性存储引擎用于保证原子性、一致性、隔离线、持久性;

    innodb_flush_log_at_trx_commit:

      0: 每秒同步,并执行磁盘flush操作;

      1: 每事务同步,并执行磁盘flush操作,默认为1;

      2:每事务同步,但不执行磁盘flush操作,性能好,数据安全难以得到保证;

MySISAM:

  不支持事务,读操作多的时候,性能好

  表锁,锁粒度大,导致并发能力不强

  不支持外键

  B树索引、FULLTEXT(全文)索引、空间索引

  支持表压缩

    .frm 表格式

    .MYD 数据文件

    .MYI 索引文件

InnoDB: OLTP

  事务

  行级锁

  B树索引,聚簇索引、自适应hash索引

  表空间,raw磁盘设备,

    .frm 表格式

    .ibd 表空间

  innodb_file_per_table ON 每表一个表空间

MRG_MYISAM: 跟MYISAM一样,可以合并多张字段类型相同的表;

CSV 利用文本文件格式存储表,性能差,在两个数据库之间移植时使用;

ARCHIVE 实现归档,可以将表中的数据归档压缩存放;

MEMORY 内存存储引擎,将表中数据都放到内存里面,性能好,数据不安全;

BLACKHOLE 黑洞存储引擎;

表类型:

  不建议使用混合使用存储引擎;

MySQL服务器产生日志的时候,也就意味着MySQL服务进程它要使用某个线程写出很多信息,我们的二进制日志一般保存到某个磁盘的某个文件里面,这个写入操作或者写出操作一般来讲都要在内存中先完成,在内存中完成以后写到磁盘上来,二进制日志可以将来用于做即时点还原和复制的,也就意味着它越早写到磁盘上越可靠,我们可以基于一种方式来往磁盘上写,sync(同步的方式),async(异步的方式)先在内存中写过会,可能过个3-5秒它再一并将写的内容同步到磁盘上去,这种性能要好,一旦我们5秒写一次,写了4秒了突然服务器进程崩溃了那这些数据都丢失了,那就意味着你要丢失4秒的操作,使用同步的方式每一次写操作不在内存中停留,虽然是在内存中完成的,在内存完成的同时要写到永久样存储上来,但是磁盘I/O跟内存比起来要差N个数量级,所以这会导致我们的性能低下的,肯定引入异步的方式要好很多,无非就是提供缓存,让它的写操作都在内存中完成,把它当作我们的缓存,在里面簇够一堆以后同步到磁盘上去,簇够多少为了尽可能避免数据簇够以后会损坏就定期往上面写,每隔一秒钟,不管簇多少了,每一秒就往磁盘上同步一次,所以这时候即便是服务器进程崩溃了也最多丢失一秒钟的事情,这是一种方式,二进制日志都是操作,可以凑够10个操作一批写一次也可以,这样带来的结果就算我们有事件丢失也最多丢失10个事件而已,或10个操作而已,这又是另外一种方式,如果我们MySQL服务器是一个事务存储引擎,跟事务性存储引擎相关,那事务性存储引擎事务提交一次,不管现在是什么时间,也不管凑够多少语句,只要提交就往磁盘上写二进制日志也可以,不管怎么讲一旦提供缓存了,提高性能的同时我们必须得关注数据本身的靠谱安全性或可靠性,这些评估标准都是我们将来在任何数据库系统上实现缓存机制时候所用到的同步机制,即能够提速又能够保证安全性,最多只丢失有限的数据,妥协、折中;

MySQL服务器为了提高性能尽可能提高并发能力,这样会带来的结果就是我们多个SQL语句可以同时执行,或者多个事务可以同时执行,而且如果我们有多个CPU的话,这个效果可能会更明显,而且两个事务之间彼此不干扰,于是多个用户线程涉及的SQL语句每一个在一个CPU可能都并发执行,而假设这几个SQL语句如果每一个都是引起数据库改变的语句,那就意味着它们都有可能写二进制日志,我们的二进制日志文件只有一个,同时写的只有一个,它们看上去很快的操作,事实上往二进制日志文件写的速度仍然会很慢,所以我们服务器的并发能力可能会比较强,但是由于二进制日志文件只有一个,它的文件流保存的数据流也只有一个,所以导致会发现二进制日志文件系统可能会带来性能低下的,尤其线程非常多的时候,所以说日志文件所在的磁盘设备性能越好,I/O能力越强意味着我们服务器整体性能就越强,所以要是弄一块SSD盘或者10块SSD盘做raid 0效果可能会更好,当前这个二进制文件很有可能成为系统并行的瓶颈的,所以应该把二进制日志文件放在一个所谓的SSD设备上,或者放在更高性能的设备上,我们可以定期的把它转移出去,同样道理,我们的从服务器还要从主服务器复制这个数据,所以不光是主服务器上的进程要写这个文件,从服务器还有去读这个文件信息的,如果从服务器非常的多,这个压力会更大了,主服务器只有写到这个数据,这个操作已经执行过了,而后过一会它有可能才同步到日志文件中,而从服务器上只有主服务器写了一次才能同步过来一个,而且同步过来一个以后,从服务器还需要自己启动一个线程在本地执行一遍,从服务器要比主服务器慢那么一点,从服务器总是会比主服务器慢半拍,这还是理想情况,而不理想的情况从服务器落后主服务器两个小时,落后两天都有可能,所以在主服务器上写了,从服务器上读没有,甚至两天以后才产生,所以说日志信息虽然给我们服务器带来数据的可靠性,但也不得不考虑它带来性能的下降,或者对性能本身的影响;

事务日志怎么工作,我们的存储引擎负责实现数据存储,它是用来跟文件打交道的,假如这是InnoDB存储引擎,InnoDB既然是支持事务的,我们的事务允许撤销,如果一个事务里面有10个SQL语句,而这10个语句有8个是写操作的,可能会产生WRITE操作,写到第5个,这些写的结果要不要保存到数据文件里面,如果直接要保存到数据文件里面会有什么问题,过一会用户又撤销了事务怎么办,我们还得从数据文件中把它删除,这也似乎没有特别大的问题,但是删除以后它此前的数据怎么办,比如原来数据是30改成了50怎么办,人家要撤销,怎么知道此前的数据是什么,怎么撤回去,这很困难,就引入了事务日志,事务日志里面到底记录的是什么,它每一行都是信息记录事务的ID号,服务器可能会启动多个事务,每个事务都有它的ID号,首先这是那个ID号的事务锁产生的日志信息,其次它影响了那个库那个表那一行,再则它的原始数据是什么,而后又改成什么数据,它只是记录了我们老的数据和新的数据,如果说我们事务当中删除了一张表,一般来讲对于DROP TABLE类的操作,事务日志是还原不了的,它只能对表中数据的操作进行还原,所以它能够记录你的老数据是什么,新数据是什么,每一个事件它都这样记录下来,过一会我们要想每一次写操作它都记录这样一个值,原数据文件并没有做修改,过一会当提交事务,于是它开始把每一个事件都给它把相应文件内容改一改,如果改了一半要撤销也成,日志信息里面的TID <old_value> <new_value>都在这里存放着,所以把它里面的new_value从新替换为原来old_value就好了,所以靠这个日志文件记录下来,类似于快照一样,即保留了老数据又保留了新数据,我们随时可以应用这个新数据到磁盘上,就算你的事务没有提交也可以应用,就算事务没提交也可以写数据文件,比如有8个写操作,把6个写操作都已经同步到数据文件里面,还剩2个,这时候我们撤销了,能撤销,日志里面有old_value再重新替换数据文件就可以了,一般来讲事务提交再写数据文件会更好,只有我们事件提交我们在写数据文件,事务只要不提交我们没同步数据文件,一但用户撤销了,我们把这些日志相关的信息给他删除就可以了,这样操作会快的多,这就是事务日志事情,所以事务日志记录了我们此前每一次跟事务执行过程当中,或者某些事务或所有事务执行过程当中的对于数据的修改的信息都会记录下来;

MySQL服务器是用户空间的进程,它所使用的内存空间叫用户空间的地址空间,而后当他执行写操作的时候它不能直接往磁盘上写,不能直接写,还要通过系统调用请求内核来完成写操作,还要向内核发起请求,也就意味着用户写的数据首先服务器自己在他自己的日志空间缓存了,其次当它提交写请求的时候它应该把这个数据传递给内核,内核又会保存到自己的内存空间,所以看上去写了,它有可能没有真正到磁盘上,还在内存当中,而我们的内核在后台每隔一段时间才真正往磁盘上写,双缓存,缓存了两次,在用户空间缓存一次,在内核空间缓存一次,看上去提交了,自己也以为提交了,真正写到磁盘上去的没有,很有可能内核中又缓存了一次,导致如果系统崩溃数据仍然可能会丢失,这是意外行为,控制不了,好在内核给我们了一种控制机制,我们告诉内核别再缓存了,直接往磁盘上写,而0就是这个意思,0就表示当我们每秒钟同步一次,而且告诉内核别再内核中缓存,直接往磁盘上写;

FIO: Fusion-IO 类似把SSD盘直接通过PCI-E的接口接到了主板的芯片上,使得跟CPU的交互能力它比内存的速度大概只慢一个数量级;

IOPS: IO每秒所能执行的I/O操作数

  100, 200

  SSD:

恢复

可以把数据文件和事务日志文件分开存放,不但如此,甚至还建议给事务日志文件做镜像,再做一个事务日志文件组,任何时候往事务文件里面写都同步到镜像文件组里面,另外一个组也是两个文件,跟事务日志文件大小一模一样,往第一组里面的0号日志中写,它的日志信息也会同步到第二组的0号日志文件里面,往第一组1号日志文件里面写,也会同步第二组的1号文件来,万一第一组硬盘挂了,第二组文件还存在;

事务日志是确保事务安全性的重要工具,而且不能手动操作事务日志,是MySQL的事务存储引擎InnoDB自己使用的,什么时候该恢复,什么时候该提交等等这都是由它自行进行维护的,这个文件大小,如果太小频繁的执行数据文件同步,如果太大下次启动恢复速度会比较慢,所以找一个折中的值,一般来讲5M其实已经相当大了,5M两个已经10M了,10M的数据对一个数据库服务器来讲,一个非常繁忙的服务器可能每秒钟会产生100M,每秒钟写入10M已经非常繁忙了,所以对于10M的日志文件已经相当大了,不到万不得已也不用调大,除非通过I/O发现有频繁的I/O操作是由于从日志文件到数据文件的,才把它调大一点;

[root@localhost ~]# mysql(连接mysql)
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.5.28-log Source distribution

Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> SHOW GLOBAL VARIABLES LIKE '%log%';(查看mysql全局变量中间包含字符log相关变量值)
+-----------------------------------------+----------------------------------------+
| Variable_name                           | Value                                  |
+-----------------------------------------+----------------------------------------+
| back_log                                | 50                                     |
| binlog_cache_size                       | 32768                                  |(二进制日志缓存的大小,它的表现取决于binlog_stmt_cache_size
大小而改变的)
| binlog_direct_non_transactional_updates | OFF                                    |
| binlog_format                           | MIXED                                  |(二进制日志格式,有三种格式STATEMENT、ROW、MINED)
| binlog_stmt_cache_size                  | 32768                                  |(跟事务相关的二进制缓存大小,二进制语句缓存大小,调整的时候也只需
要调整binlog_stmt_cache_size,并不建议把这个值调的太大,调大性能会有提升,但是丢失的数据量会变大的)
| expire_logs_days                        | 0                                      |(日志过期天数,多少天让日志过期,过期的会自动删除,不能让自动清理)
| general_log                             | OFF                                    |
| general_log_file                        | /mydata/data/localhost.log             |
| innodb_flush_log_at_trx_commit          | 1                                      |(在事务提交的时候flush_log的行为,是不是有事务提交我们就FLUSH
 LOG,将内存中的日志事件同步到日志文件中的行为,从日志文件同步到数据文件是由mysql后台服务线程自动进行的,1表示每当有事务提交或者每隔1秒钟都会往磁盘上写,2表示每事务
提交才同步,0表示每1秒同步一次)
| innodb_locks_unsafe_for_binlog          | OFF                                    |
| innodb_log_buffer_size                  | 8388608                                |(内存缓存大小,8M)
| innodb_log_file_size                    | 5242880                                |(日志文件大小,5M)
| innodb_log_files_in_group               | 2                                      |(日志文件总数,两个轮流写数据)
| innodb_log_group_home_dir               | ./                                     |(日志组锁放的目录,当前目录指的是数据目录)
| innodb_mirrored_log_groups              | 1                                      |(给事务日志文件组做镜像,需要指定镜像文件位置)
| log                                     | OFF                                    |
| log_bin                                 | ON                                     |(是否启用二进制日志,默认情况下只要使用了MySQL服务器给我们提供
的配置文件,二进制日志一般都是开启的,二进制日志的功能开启并不意味着就一定会记录二进制日志,这是总开关,如果要记录就可能给我们指定日志文件上开始记录日志,这个指令它还
可以接受文件路径表示我们把二进制日志文件记录在另外一个位置,否则只写一个ON就表示记录在MySQL数据目录下叫mysql-bin-00000x的文件,它还可以接受文件路径,其次它指定了
我们整个二进制日志文件是否启用以及到底记录那个文件中,)
| log_bin_trust_function_creators         | OFF                                    |
| log_error                               | /mydata/data/localhost.localdomain.err |
| log_output                              | FILE                                   |
| log_queries_not_using_indexes           | OFF                                    |
| log_slave_updates                       | OFF                                    |
| log_slow_queries                        | OFF                                    |
| log_warnings                            | 1                                      |
| max_binlog_cache_size                   | 18446744073709547520                   |(最大允许使用多大缓存,上线值)
| max_binlog_size                         | 1073741824                             |
| max_binlog_stmt_cache_size              | 18446744073709547520                   |(最大允许事务缓存多大,上线值)
| max_relay_log_size                      | 0                                      |
| relay_log                               |                                        |
| relay_log_index                         |                                        |
| relay_log_info_file                     | relay-log.info                         |
| relay_log_purge                         | ON                                     |
| relay_log_recovery                      | OFF                                    |
| relay_log_space_limit                   | 0                                      |
| slow_query_log                          | OFF                                    |
| slow_query_log_file                     | /mydata/data/localhost-slow.log        |
| sql_log_bin                             | ON                                     |(用于控制二进制日志信息是否记录仅日志文件,动态变量,可以直接手
动关闭,把它改为OFF就算现在写了很多DML或者DDL语句它也不会记录这些相关信息,这个指令非常有用,尤其是在实现数据库恢复的时候,比如mysql服务器崩溃了,做了备份,使用备
份文件现在需要导入到数据库将这些数据恢复到某一时刻,在这个恢复过程当中,应该临时把二进制日志关闭,等恢复以后再把它启用起来)
| sql_log_off                             | OFF                                    |(是否禁止将一般查询日志记录进查询日志文件)
| sync_binlog                             | 0                                      |(多久同步一次二进制日志到磁盘文件,0表示不同步,取决于事务auto
commit自动提交,当autocommit为1的时候,每条语句都会同步,否则每次手动提交才同步,任何正数值表示对二进制每多少次写操作之后同步一次)
| sync_relay_log                          | 0                                      |
| sync_relay_log_info                     | 0                                      |
+-----------------------------------------+----------------------------------------+
41 rows in set (0.00 sec)

[root@localhost ~]# bc(计算器)
bc 1.06
Copyright 1991-1994, 1997, 1998, 2000 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'. 
5242880/1024/1024
5
quit(退出)

[root@localhost ~]# cd /mydata/data/(切换到/mydata/data目录)
[root@localhost data]# ll(查看当前目录文件及子目录详细信息)
total 28904
drwx------ 2 mysql mysql     4096 Feb 27 04:33 cactidb
drwx------ 2 mysql mysql     4096 Feb 26 10:31 edb
drwx------ 2 mysql mysql     4096 Feb 24 14:29 hellodb
-rw-rw---- 1 mysql mysql 18874368 Feb 27 12:02 ibdata1
-rw-rw---- 1 mysql mysql  5242880 Feb 27 12:02 ib_logfile0(innodb事务日志文件,不管用不用上来都是5M大小空间,而且在磁盘上一定是连续的空间)
-rw-rw---- 1 mysql mysql  5242880 Feb 24 00:30 ib_logfile1(innodb事务日志文件,不管用不用上来都是5M大小空间,而且在磁盘上一定是连续的空间)
drwx------ 2 mysql mysql     4096 Feb 26 12:00 jiaowu
-rw-rw---- 1 mysql root      8935 Feb 27 12:02 localhost.localdomain.err
-rw-rw---- 1 mysql mysql        6 Feb 27 12:02 localhost.localdomain.pid
-rw-rw---- 1 mysql mysql      175 Feb 27 10:53 localhost-slow.log
drwx------ 2 mysql mysql     4096 Feb 24 11:58 mydb
drwx------ 2 mysql root      4096 Feb 24 00:27 mysql
-rw-rw---- 1 mysql mysql    16214 Feb 27 05:37 mysql-bin.000003
-rw-rw---- 1 mysql mysql      390 Feb 27 05:59 mysql-bin.000004
-rw-rw---- 1 mysql mysql      377 Feb 27 12:02 mysql-bin.000005
-rw-rw---- 1 mysql mysql      150 Feb 27 12:05 mysql-bin.000006
-rw-rw---- 1 mysql mysql      177 Feb 27 12:07 mysql-bin.000007
-rw-rw---- 1 mysql mysql       95 Feb 27 12:13 mysql-bin.index
drwx------ 2 mysql mysql     4096 Feb 24 00:27 performance_schema
drwx------ 2 mysql mysql     4096 Feb 25 19:52 students
drwx------ 2 mysql root      4096 Feb 24 00:27 test
drwx------ 2 mysql mysql     4096 Feb 24 12:37 testdb

mysql> SHOW ENGINES;(显示mysql存储引擎)
+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
| Engine             | Support | Comment                                                        | Transactions | XA   | Savepoints |
+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
| MyISAM             | YES     | MyISAM storage engine                                          | NO           | NO   | NO         |
| InnoDB             | DEFAULT | Supports transactions, row-level locking, and foreign keys     | YES          | YES  | YES        |
| PERFORMANCE_SCHEMA | YES     | Performance Schema                                             | NO           | NO   | NO         |
| BLACKHOLE          | YES     | /dev/null storage engine (anything you write to it disappears) | NO           | NO   | NO         |
| MRG_MYISAM         | YES     | Collection of identical MyISAM tables                          | NO           | NO   | NO         |
| CSV                | YES     | CSV storage engine                                             | NO           | NO   | NO         |
| ARCHIVE            | YES     | Archive storage engine                                         | NO           | NO   | NO         |
| MEMORY             | YES     | Hash based, stored in memory, useful for temporary tables      | NO           | NO   | NO         |
+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
8 rows in set (0.00 sec)

mysql> SHOW GLOBAL VARIABLES LIKE 'innodb%';(查看mysql全局变量innodb开头的变量值)
+---------------------------------+------------------------+
| Variable_name                   | Value                  |
+---------------------------------+------------------------+
| innodb_adaptive_flushing        | ON                     |
| innodb_adaptive_hash_index      | ON                     |
| innodb_additional_mem_pool_size | 8388608                |
| innodb_autoextend_increment     | 8                      |
| innodb_autoinc_lock_mode        | 1                      |
| innodb_buffer_pool_instances    | 1                      |
| innodb_buffer_pool_size         | 134217728              |
| innodb_change_buffering         | all                    |
| innodb_checksums                | ON                     |
| innodb_commit_concurrency       | 0                      |
| innodb_concurrency_tickets      | 500                    |
| innodb_data_file_path           | ibdata1:10M:autoextend |
| innodb_data_home_dir            |                        |
| innodb_doublewrite              | ON                     |
| innodb_fast_shutdown            | 1                      |
| innodb_file_format              | Antelope               |
| innodb_file_format_check        | ON                     |
| innodb_file_format_max          | Antelope               |
| innodb_file_per_table           | ON                     |(每个表一个表空间)
| innodb_flush_log_at_trx_commit  | 1                      |
| innodb_flush_method             |                        |
| innodb_force_load_corrupted     | OFF                    |
| innodb_force_recovery           | 0                      |
| innodb_io_capacity              | 200                    |
| innodb_large_prefix             | OFF                    |
| innodb_lock_wait_timeout        | 50                     |
| innodb_locks_unsafe_for_binlog  | OFF                    |
| innodb_log_buffer_size          | 8388608                |
| innodb_log_file_size            | 5242880                |
| innodb_log_files_in_group       | 2                      |
| innodb_log_group_home_dir       | ./                     |
| innodb_max_dirty_pages_pct      | 75                     |
| innodb_max_purge_lag            | 0                      |
| innodb_mirrored_log_groups      | 1                      |
| innodb_old_blocks_pct           | 37                     |
| innodb_old_blocks_time          | 0                      |
| innodb_open_files               | 300                    |
| innodb_purge_batch_size         | 20                     |
| innodb_purge_threads            | 0                      |
| innodb_random_read_ahead        | OFF                    |
| innodb_read_ahead_threshold     | 56                     |
| innodb_read_io_threads          | 4                      |
| innodb_replication_delay        | 0                      |
| innodb_rollback_on_timeout      | OFF                    |
| innodb_rollback_segments        | 128                    |
| innodb_spin_wait_delay          | 6                      |
| innodb_stats_method             | nulls_equal            |
| innodb_stats_on_metadata        | ON                     |
| innodb_stats_sample_pages       | 8                      |
| innodb_strict_mode              | OFF                    |
| innodb_support_xa               | ON                     |
| innodb_sync_spin_loops          | 30                     |
| innodb_table_locks              | ON                     |
| innodb_thread_concurrency       | 0                      |
| innodb_thread_sleep_delay       | 10000                  |
| innodb_use_native_aio           | OFF                    |
| innodb_use_sys_malloc           | ON                     |
| innodb_version                  | 1.1.8                  |
| innodb_write_io_threads         | 4                      |
+---------------------------------+------------------------+
59 rows in set (0.00 sec)

MYSQL的备份和还原

  备份: 副本

  RAID1, RAID10: 保证迎接损坏而不会导致业务中止;

    DROP TABLE mydb.tb1;

  备份类型:

    热备份、温备份和冷备份

      热备份:在线备份,读、写不受影响;

      温备份: 仅可以执行读操作;

      冷备份:离线备份: 读、写操作均中止;

    物理备份和逻辑备份

      物理备份: 复制数据文件;

      逻辑备份:将数据导出至文本文件中;

    完全备份、增量备份和差异备份:备份的策略是完全加增量或者完全加差异;

      完全备份: 备份全部数据;

      增量备份:仅备份上次完全备份或增量备份以后变化的数据,占据空间少,恢复的时候需要完全备份和每次增量备份;

      差异备份:仅备份上次完全备份以来变化的数据,管理简单,恢复的时候只需要恢复完全和最后一次的差异备份;

  在线: 物理完全备份

还原: 要经常进行还原测试,万一备份文件还原不了;

    备份什么:

      数据、配置文件、二进制日志、事务日志

热备份:

  MyISAM: 温备份,锁定MyISAM所有表,而且以共享方式锁定,这时候别人就不能改,将数据复制出来一份,LV逻辑备份,

  InnoDB: 支持热备,备份工具,xtrabackup热备物理备份,mysqldump逻辑备份,性能差

MySQL --> 从: 把MySQL在线提供服务,给它做一个从服务器,过一段时间需要备份把从服务器停下来,备份好以后,再让它启动起来,它会再从主服务器从上次停那一刻进行同步;

物理备份: 直接复制数据文件,如果这个数据文件本身跟文件系统没有关系,那它跨平台能力很强,移植性也很强,但是有些存储引擎的数据文件可能跟文件系统有关系,所以会导致它的移植能力不是很强,但是物理备份特点速度非常快,不需要借助MySQL服务器自身再做任何处理;

逻辑备份: 过程需要MySQL进程参与,因此速度慢、丢失浮点数精度,方便使用文本处理工具直接对其处理、可移植能力强;

备份策略: 完全+增量;完全+差异

MySQL备份工具:

mysqldump: 逻辑备份工具、MyISAM(温备)、InnoDB(热备份)

mysqlhotcopy: 物理备份工具、温备份

文件系统工具:

cp: 冷备份

lv: 逻辑卷的快照功能,几乎热备;

  mysql> FLUSH TABLES;

  mysql> LOCK TABLES

  创建快照: 释放锁,而后复制数据

  InnoDB:

第三组工具:

  ibbackup: 商业工具

  xtrabackup: 开源工具

mysqldump: 逻辑备份

  mysqldump(完全备份) + 二进制日志

  完全+增量:

备份单个数据库,或者备份某张表

  mysqldump DB_NAME [tb1] [tb2] (不具备自动创建数据库命令;)

--master-data={0|1|2}

  0: 不记录二进制日志文件及其事件位置;

  1: 以CHANGE MASTER TO的方式记录位置,可用于恢复后直接启动从服务器;

  2: 以CHANGE MASTER TO的方式记录位置,但默认为被注释;


--lock-all-tables: 锁定所有表

--flush-logs: 执行日志flush;

如果指定库中的表类型均为InnoDB,可使用--single-transaction启动热备份,既然启动热备,所以不要跟--lock-all-tables一起使用;

 

备份多个库:

  --all-databases: 备份所有库,恢复的时候自动创建数据库;

  --databases DB_NAME,DB_NAME,...: 备份指定库,恢复的时候自动创建数据库;

  --events 备份数据库上的事件调度器;

  --routines 备份存储过程和存储函数

  --triggers 备份触发器;

备份策略:每周完全+每日增量

  完全备份: mysqldump

  增量备份: 备份二进制日志文件(flush logs)

Backup Tools Overview

mysqldump

Provides a logical backup of entire database servers, individual databases, individual tables, or even subsets of data using the --where option

The logical backup created using mysqldump is often called a data dump: 数据泵出

The output is in ASCII format - easily readable and manipulated

The Options of mysqldump

db_name [tbl1] [tbl2]] 备份指定数据库

--all-databases

--databases

--events 备份数据库上的事件调度器;

--extended-insert

--flush-logs 手动滚动二进制日志文件一次;

--insert-ignore

--local-all-tables 锁定所有表

--lock-tables 锁定指定表

--master-data=n 记录二进制日志文件位置;

--no-data

--opt

--replace

--routines 备份存储过程和存储函数的

--single-transaction 在InnoDB存储引擎,可以启动热备份;

--triggers 备份触发器

--where WHERE clause

[root@localhost ~]# man mysqldump(查看mysqldump的man帮助)

       mysqldump - a database backup program(数据库备份工具)

[root@localhost ~]# man mysqlhotcopy(查看mysqlhotcopy的man帮助)

       mysqlhotcopy - a database backup program(数据库备份工具)

[root@localhost ~]# mysqldump -uroot -p jiaowu > /root/jiaowu.sql(备份jiaowu库到/root目录叫jiaowu.sql)
Enter password: 
[root@localhost ~]# ls(查看当前目录文件及子目录)
anaconda-ks.cfg  cmake-2.8.8         install.log         jiaowu.sql    mysql-5.5.28.tar.gz
a.sql            cmake-2.8.8.tar.gz  install.log.syslog  mysql-5.5.28  test.sql
[root@localhost ~]# vim jiaowu.sql(编辑jiaowu.sql文件)

-- MySQL dump 10.13  Distrib 5.5.28, for Linux (i686)
--
-- Host: localhost    Database: jiaowu
-- ------------------------------------------------------
-- Server version	5.5.28-log

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `courses`
--

DROP TABLE IF EXISTS `courses`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `courses` (
  `CID` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  `Cname` varchar(100) NOT NULL,
  `TID` smallint(6) NOT NULL,
  UNIQUE KEY `CID` (`CID`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `courses`
--

LOCK TABLES `courses` WRITE;
/*!40000 ALTER TABLE `courses` DISABLE KEYS */;
INSERT INTO `courses` VALUES (1,'Hamagong',2),(2,'TaiJiquan',3),(3,'Yiyangzhi',6),(4,'Jinshejianfa',1),(5,'Qianzhuwandushou',4),(6,'Qi
shangquan',5),(7,'Qiankundanuoyi',7),(8,'Wanliduxing',8),(9,'Pixiejianfa',3),(10,'Jiuyinbaiguzhua',7);
/*!40000 ALTER TABLE `courses` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `scores`
--

DROP TABLE IF EXISTS `scores`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `scores` (
  `ID` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  `SID` smallint(6) NOT NULL,
  `CID` smallint(6) NOT NULL,
  `Score` float DEFAULT NULL,
  UNIQUE KEY `ID` (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `scores`
--

LOCK TABLES `scores` WRITE;
/*!40000 ALTER TABLE `scores` DISABLE KEYS */;
INSERT INTO `scores` VALUES (1,2,2,67),(2,2,3,71),(3,1,2,90),(4,1,7,45),(5,3,6,32),(6,3,1,99),(7,4,8,95),(8,4,10,36);
/*!40000 ALTER TABLE `scores` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Temporary table structure for view `sct`
--

DROP TABLE IF EXISTS `sct`;
/*!50001 DROP VIEW IF EXISTS `sct`*/;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
/*!50001 CREATE TABLE `sct` (
  `Name` tinyint NOT NULL,
  `Cname` tinyint NOT NULL,
  `Tname` tinyint NOT NULL
) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client;

--
-- Table structure for table `students`
--

DROP TABLE IF EXISTS `students`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `students` (
  `SID` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  `Name` varchar(50) NOT NULL,
  `Age` tinyint(3) unsigned DEFAULT NULL,
  `Gender` enum('F','M') DEFAULT 'M',
  `CID1` smallint(5) unsigned DEFAULT NULL,
  `CID2` smallint(5) unsigned DEFAULT NULL,
  `TID` smallint(6) DEFAULT NULL,
  `CreateTime` datetime DEFAULT '2012-04-06 10:00:00',
  UNIQUE KEY `SID` (`SID`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `students`
--

LOCK TABLES `students` WRITE;
/*!40000 ALTER TABLE `students` DISABLE KEYS */;
INSERT INTO `students` VALUES (1,'tom',30,'F',NULL,NULL,NULL,'2012-04-06 10:00:00');
/*!40000 ALTER TABLE `students` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `tutors`
--

DROP TABLE IF EXISTS `tutors`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tutors` (
  `TID` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  `Tname` varchar(50) NOT NULL,
  `Gender` enum('F','M') DEFAULT 'M',
  `Age` tinyint(3) unsigned DEFAULT NULL,
  UNIQUE KEY `TID` (`TID`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `tutors`
--

LOCK TABLES `tutors` WRITE;
/*!40000 ALTER TABLE `tutors` DISABLE KEYS */;
INSERT INTO `tutors` VALUES (1,'HongQigong','M',93),(2,'HuangYaoshi','M',63),(3,'Miejueshitai','F',72),(4,'OuYangfeng','M',76),(5,'YiDeng'
,'M',90),(6,'YuCanghai','M',56),(7,'Jinlunfawang','M',67),(8,'HuYidao','M',42),(9,'NingZhongze','F',49),(10,'Tom','F',30),(11,'DingDian',
'M',25),(12,'HuFei','M',25),(13,'stu100','M',30);
/*!40000 ALTER TABLE `tutors` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Final view structure for view `sct`
--

/*!50001 DROP TABLE IF EXISTS `sct`*/;
/*!50001 DROP VIEW IF EXISTS `sct`*/;
/*!50001 SET @saved_cs_client          = @@character_set_client */;
/*!50001 SET @saved_cs_results         = @@character_set_results */;
/*!50001 SET @saved_col_connection     = @@collation_connection */;
/*!50001 SET character_set_client      = latin1 */;
/*!50001 SET character_set_results     = latin1 */;
/*!50001 SET collation_connection      = latin1_swedish_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `sct` AS select `students`.`Name` AS `Name`,`courses`.`Cname` AS `Cname`,`tutors`.`Tname` AS `Tname` from ((`students` join
 `courses`) join `tutors`) where ((`students`.`CID1` = `courses`.`CID`) and (`courses`.`TID` = `tutors`.`TID`)) */;
/*!50001 SET character_set_client      = @saved_cs_client */;
/*!50001 SET character_set_results     = @saved_cs_results */;
/*!50001 SET collation_connection      = @saved_col_connection */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2016-02-28  0:52:34

提示:mysqldump备份是将mysql整个数据备份为批量插入的INSERT语句;

mysql> DROP DATABASE jiaowu;(删除jiaowu数据库)
Query OK, 5 rows affected (0.02 sec)

mysql> \q(退出)
Bye

[root@localhost ~]# mysql < jiaowu.sql(将jiaowu.sql的mysql脚步导入mysql)
ERROR 1046 (3D000) at line 22: No database selected
提示:mysqldump它没办法创建数据库,提示没有数据库选择;

[root@localhost ~]# mysql(连接mysql数据库)
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 5.5.28-log Source distribution

Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> CREATE DATABASE studb;(创建studb数据库)
Query OK, 1 row affected (0.01 sec)
提示:更改数据库名称是完全可以的;

mysql> \q(退出)
Bye

[root@localhost ~]# mysql studb < jiaowu.sql(将jiaowu.sql的sql脚步导入到studb数据库中)
提示:向刚才这里我们在备份的时候,这到底是什么备份,热备、温备、冷备,我们的mysql服务器在线,必须的mysql服务器在线,这是逻辑备份,它要导出mysql服务器进程通信,但
是如果有其它人正在往这个数据库中写数据的话会带来什么结果,会带来时间点上的不一致,因此我们真正备份的时候千万不能这么做,应该锁表;
[root@localhost ~]# mysql(连接数据库)
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 12
Server version: 5.5.28-log Source distribution

Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> FLUSH TABLES WITH READ LOCK;(刷新表并且以读的方式锁定,这样照样别人能够查询,但是不能写了)
Query OK, 0 rows affected (0.00 sec)

测试:通过Xshell打开一个终端连接mysql数据库;
[root@localhost ~]# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 13
Server version: 5.5.28-log Source distribution

Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> USE studb;(修改默认数据库为studb)
Database changed
mysql> SELECT * FROM tutors;(查看tutors表中所有字段数据)
+-----+--------------+--------+------+
| TID | Tname        | Gender | Age  |
+-----+--------------+--------+------+
|   1 | HongQigong   | M      |   93 |
|   2 | HuangYaoshi  | M      |   63 |
|   3 | Miejueshitai | F      |   72 |
|   4 | OuYangfeng   | M      |   76 |
|   5 | YiDeng       | M      |   90 |
|   6 | YuCanghai    | M      |   56 |
|   7 | Jinlunfawang | M      |   67 |
|   8 | HuYidao      | M      |   42 |
|   9 | NingZhongze  | F      |   49 |
|  10 | Tom          | F      |   30 |
|  11 | DingDian     | M      |   25 |
|  12 | HuFei        | M      |   25 |
|  13 | stu100       | M      |   30 |
+-----+--------------+--------+------+
13 rows in set (0.00 sec)

提示:查询可以,但是往里面写数据不可以;

mysql> INSERT INTO tutors (Tname) VALUES ('hellodb');(向tutors表中的Tname字段插入数据)

提示:向tutors表中插入数据的时候,命令会卡住,因为数据库执行了读锁表,而且它锁定了所有表;

[root@localhost ~]# mysqldump -uroot -p studb > /root/studb.sql(备份数据库studb到/root目录叫studb.sql)
Enter password: 

mysql> UNLOCK TABLES;(解锁所有表的读所表)
Query OK, 0 rows affected (0.00 sec)

mysql> INSERT INTO tutors (Tname) VALUES ('hellodb');(向tutors表中Tname字段插入数据)
Query OK, 1 row affected (3 min 5.24 sec)

提示:刚才向tutors表中Tname字段插入的数据命令也执行成功了,但是刚才备份的数据不包含插入的数据,拿着刚才备份去还原不能还原到服务器当前这一刻,这些数据可以从二进制日
志文件中读出来,但是二进制日志从那一刻开始,二进制日志文件中保存了很多事件,我们等一会真正拿来去还原,应该使用刚才的完全备份加完全备份以后所发生的新的事件,但怎么知道
二进制日志文件当中刚才我们从那个时间开始的,那个位置或者那个时间点,很难知道,为了尽可能做到万无一失,要锁表,然后手动实现滚动二进制日志文件滚动一次;

mysql> FLUSH TABLES WITH READ LOCK;(刷新表并且以读的方式锁定,这样照样别人能够查询,但是不能写了)
Query OK, 0 rows affected (0.00 sec)

mysql> FLUSH LOGS;(手动实现二进制日志滚动一次)
Query OK, 0 rows affected (0.02 sec)

mysql> SHOW BINARY LOGS;(查看正在使用的二进制日志文件)
+------------------+-----------+
| Log_name         | File_size |
+------------------+-----------+
| mysql-bin.000003 |     16214 |
| mysql-bin.000004 |       390 |
| mysql-bin.000005 |       377 |
| mysql-bin.000006 |       150 |
| mysql-bin.000007 |      6000 |
| mysql-bin.000008 |       107 |
+------------------+-----------+
6 rows in set (0.00 sec)

提示:刚才手动实现二进制日志滚动一次,mysql-bin.000007和它之前的二进制日志文件都不用了,新开启一个mysql-bin.000008,也就意味着我们所有内容其实mysql-bin.0000
08中所产生的新的日志,所以要SHOW BINARY LOGS;记录下来到底从那个二进制文件开始的,再次之前先做一次手动二进制日志文件滚动,问题是我们备份下来得自己记录这个备份对应
的二进制文件的名次和位置,这太痛苦了,还有一个办法;

mysql> \q(退出)
Bye

[root@localhost ~]# mysqldump -uroot -p studb > /root/studb-`date +%F-%H-%M-%S`.sql(备份studb数据库到/root目录叫studb-`date +%F-%H-%M-%S.sql)
Enter password: 
[root@localhost ~]# ls(查看当前目录文件及子目录)
anaconda-ks.cfg  cmake-2.8.8         install.log         jiaowu.sql    mysql-5.5.28.tar.gz            studb.sql
a.sql            cmake-2.8.8.tar.gz  install.log.syslog  mysql-5.5.28  studb-2016-02-28-01-55-28.sql  test.sql
[root@localhost ~]# mysqldump -uroot -p --master-data=2 studb > /root/studb-`date +%F-%H-%M-%S`.sql(备份studb数据库到/root目录叫studb-`date 
+%F-%H-%M-%S.sql,--master-data=2以CHANGE MASTER TO方式记录位置,但默认备注释)
Enter password: 
[root@localhost ~]# ll(查看当前目录文件及子目录详细信息)
total 29896
-rw-------  1 root root      1074 Nov 22  2014 anaconda-ks.cfg
-rw-r--r--  1 root root      1642 Feb 27 11:57 a.sql
drwxr-xr-x 13 root root      4096 Feb 23 22:09 cmake-2.8.8
-rw-r--r--  1 root root   5691656 Nov 22  2014 cmake-2.8.8.tar.gz
-rw-r--r--  1 root root     28330 Nov 22  2014 install.log
-rw-r--r--  1 root root      3672 Nov 22  2014 install.log.syslog
-rw-r--r--  1 root root      6338 Feb 28 00:52 jiaowu.sql
drwxr-xr-x 32 7161 wheel     4096 Feb 24 00:19 mysql-5.5.28
-rw-r--r--  1 root root  24739429 Nov 22  2014 mysql-5.5.28.tar.gz
-rw-r--r--  1 root root      6361 Feb 28 01:55 studb-2016-02-28-01-55-28.sql
-rw-r--r--  1 root root      6509 Feb 28 01:58 studb-2016-02-28-01-58-50.sql
-rw-r--r--  1 root root      6337 Feb 28 01:22 studb.sql
-rw-r--r--  1 root root        72 Feb 24 12:31 test.sql
[root@localhost ~]# less studb-2016-02-28-01-58-50.sql(分页显示studb-2016-02-28-01-58-50.sql文件内容)

-- MySQL dump 10.13  Distrib 5.5.28, for Linux (i686)
--
-- Host: localhost    Database: studb
-- ------------------------------------------------------
-- Server version	5.5.28-log

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Position to start replication or point-in-time recovery from
--

-- CHANGE MASTER TO MASTER_LOG_FILE='mysql-bin.000008', MASTER_LOG_POS=107;(它明确说明了当前这个日志文件是mysql-bin.000008,而且事件位置是107,
所以下一次我们从二进制日志中备份数据的时候,从107位置向后备份就可以了)

--
-- Table structure for table `courses`
--

DROP TABLE IF EXISTS `courses`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `courses` (
  `CID` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  `Cname` varchar(100) NOT NULL,
  `TID` smallint(6) NOT NULL,
  UNIQUE KEY `CID` (`CID`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `courses`
--

LOCK TABLES `courses` WRITE;
/*!40000 ALTER TABLE `courses` DISABLE KEYS */;
INSERT INTO `courses` VALUES (1,'Hamagong',2),(2,'TaiJiquan',3),(3,'Yiyangzhi',6),(4,'Jinshejianfa',1),(5,'Qianzhuwandushou',4),(6,'Qish
angquan',5),(7,'Qiankundanuoyi',7),(8,'Wanliduxing',8),(9,'Pixiejianfa',3),(10,'Jiuyinbaiguzhua',7);
/*!40000 ALTER TABLE `courses` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `scores`
--

DROP TABLE IF EXISTS `scores`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `scores` (
  `ID` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  `SID` smallint(6) NOT NULL,
  `CID` smallint(6) NOT NULL,
  `Score` float DEFAULT NULL,
  UNIQUE KEY `ID` (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `scores`
--

LOCK TABLES `scores` WRITE;
/*!40000 ALTER TABLE `scores` DISABLE KEYS */;
INSERT INTO `scores` VALUES (1,2,2,67),(2,2,3,71),(3,1,2,90),(4,1,7,45),(5,3,6,32),(6,3,1,99),(7,4,8,95),(8,4,10,36);
/*!40000 ALTER TABLE `scores` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Temporary table structure for view `sct`
--

DROP TABLE IF EXISTS `sct`;
/*!50001 DROP VIEW IF EXISTS `sct`*/;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
/*!50001 CREATE TABLE `sct` (
  `Name` tinyint NOT NULL,
  `Cname` tinyint NOT NULL,
  `Tname` tinyint NOT NULL
) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client;

--
-- Table structure for table `students`
--

DROP TABLE IF EXISTS `students`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `students` (
  `SID` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  `Name` varchar(50) NOT NULL,
  `Age` tinyint(3) unsigned DEFAULT NULL,
  `Gender` enum('F','M') DEFAULT 'M',
  `CID1` smallint(5) unsigned DEFAULT NULL,
  `CID2` smallint(5) unsigned DEFAULT NULL,
  `TID` smallint(6) DEFAULT NULL,
  `CreateTime` datetime DEFAULT '2012-04-06 10:00:00',
  UNIQUE KEY `SID` (`SID`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `students`
--

LOCK TABLES `students` WRITE;
/*!40000 ALTER TABLE `students` DISABLE KEYS */;
INSERT INTO `students` VALUES (1,'tom',30,'F',NULL,NULL,NULL,'2012-04-06 10:00:00');
/*!40000 ALTER TABLE `students` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `tutors`
--

DROP TABLE IF EXISTS `tutors`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tutors` (
  `TID` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  `Tname` varchar(50) NOT NULL,
  `Gender` enum('F','M') DEFAULT 'M',
  `Age` tinyint(3) unsigned DEFAULT NULL,
  UNIQUE KEY `TID` (`TID`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `tutors`
--

LOCK TABLES `tutors` WRITE;
/*!40000 ALTER TABLE `tutors` DISABLE KEYS */;
INSERT INTO `tutors` VALUES (1,'HongQigong','M',93),(2,'HuangYaoshi','M',63),(3,'Miejueshitai','F',72),(4,'OuYangfeng','M',76),(5,'YiDeng'
,'M',90),(6,'YuCanghai','M',56),(7,'Jinlunfawang','M',67),(8,'HuYidao','M',42),(9,'NingZhongze','F',49),(10,'Tom','F',30),(11,'DingDian',
'M',25),(12,'HuFei','M',25),(13,'stu100','M',30),(14,'hellodb','M',NULL);
/*!40000 ALTER TABLE `tutors` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Final view structure for view `sct`
--

/*!50001 DROP TABLE IF EXISTS `sct`*/;
/*!50001 DROP VIEW IF EXISTS `sct`*/;
/*!50001 SET @saved_cs_client          = @@character_set_client */;
/*!50001 SET @saved_cs_results         = @@character_set_results */;
/*!50001 SET @saved_col_connection     = @@collation_connection */;
/*!50001 SET character_set_client      = latin1 */;
/*!50001 SET character_set_results     = latin1 */;
/*!50001 SET collation_connection      = latin1_swedish_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `sct` AS select `students`.`Name` AS `Name`,`courses`.`Cname` AS `Cname`,`tutors`.`Tname` AS `Tname` from ((`students` join
 `courses`) join `tutors`) where ((`students`.`CID1` = `courses`.`CID`) and (`courses`.`TID` = `tutors`.`TID`)) */;
/*!50001 SET character_set_client      = @saved_cs_client */;
/*!50001 SET character_set_results     = @saved_cs_results */;
/*!50001 SET collation_connection      = @saved_col_connection */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2016-02-28  1:58:53

[root@localhost ~]# mysqldump -uroot -p --lock-all-tables --flush-logs --all-databases > /root/all.sql(备份所有库到/root目录叫all.sql,--lock
-all-tables以只读方式锁定所有表,--flush-logs手动让二进制日志文件滚动一次,--all-databases所有库)
Enter password: 
[root@localhost ~]# mysqldump -uroot -p --lock-all-tables --flush-logs --all-databases --master-data=2 > /root/all.sql(备份所有库到/root目录
叫all.sql,--lock-alltables以只读方式锁定所有表,--flush-logs手动让二进制日志文件滚动一次,--all-databases所有库,--master-data=2以CHANGE MASTER TO
的方式记录位置,但默认被注释)
Enter password: 
[root@localhost ~]# less all.sql(分页显示all.sql文件)

-- CHANGE MASTER TO MASTER_LOG_FILE='mysql-bin.000010', MASTER_LOG_POS=107;(是那个二进制日志文件,从那个位置开始都记录下来了)

-- Current Database: `cactidb`(当前库)

USE `cactidb`;(默认数据库)

提示:它会自动创建数据库的;

备份策略:每周完全+每日增量:
    完全备份: mysqldump
    增量备份: 备份二进制日志文件(flush logs)

[root@localhost ~]# mysqldump -uroot -p --master-data=2 --flush-logs --all-databases --lock-all-tables > /root/alldatabases.sql(备份所有库
到/root目录叫alldatabases.sql,--master-data=2以CHANGE MASTER TO的方式记录位置,但默认备注释,--flush-logs手动让二进制日志文件滚动一次,--all-databa
ses所有库,--local-all-tables锁定所有表)
Enter password: 
[root@localhost ~]# mysql(连接mysql)
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 22
Server version: 5.5.28-log Source distribution

Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> \q(退出)   
Bye

[root@localhost ~]# less alldatabases.sql(分页显示alldatabases.sql文件内容)

-- CHANGE MASTER TO MASTER_LOG_FILE='mysql-bin.000011', MASTER_LOG_POS=107;(当前二进制日志文件是mysql-bin.000011,事件位置是107,mysql-bin.000
011之前的可以删掉了)

[root@localhost ~]# mysql(连接mysql)
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 23
Server version: 5.5.28-log Source distribution

Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> PURGE BINARY LOGS TO 'mysql-bin.000011';(删除mysql-bin.000011之前的所有二进制日志文件)
Query OK, 0 rows affected (0.01 sec)

mysql> SHOW BINARY LOGS;(显示正在使用的二进制日志文件)
+------------------+-----------+
| Log_name         | File_size |
+------------------+-----------+
| mysql-bin.000011 |       107 |
+------------------+-----------+
1 row in set (0.00 sec)

提示:其实不建议直接删掉,应该先复制到其它地方备份再删除;

mysql> USE studb;(修改默认数据库为studb)
Database changed

mysql> SELECT * FROM tutors;(查看tutors表所有字段数据)
+-----+--------------+--------+------+
| TID | Tname        | Gender | Age  |
+-----+--------------+--------+------+
|   1 | HongQigong   | M      |   93 |
|   2 | HuangYaoshi  | M      |   63 |
|   3 | Miejueshitai | F      |   72 |
|   4 | OuYangfeng   | M      |   76 |
|   5 | YiDeng       | M      |   90 |
|   6 | YuCanghai    | M      |   56 |
|   7 | Jinlunfawang | M      |   67 |
|   8 | HuYidao      | M      |   42 |
|   9 | NingZhongze  | F      |   49 |
|  10 | Tom          | F      |   30 |
|  11 | DingDian     | M      |   25 |
|  12 | HuFei        | M      |   25 |
|  13 | stu100       | M      |   30 |
|  14 | hellodb      | M      | NULL |
+-----+--------------+--------+------+
14 rows in set (0.00 sec)

mysql> DELETE FROM tutors WHERE Age>80;(删除tutors表条件Age大于80的行)
Query OK, 2 rows affected (0.01 sec)

mysql> \q(退出)
Bye

提示:假如这天过去了就做了这么多操作,该做增量备份了;

[root@localhost ~]# mysql(连接mysql)
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 24
Server version: 5.5.28-log Source distribution

Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> FLUSH LOGS;(手动滚动一次二进制日志文件)
Query OK, 0 rows affected (0.01 sec)

mysql> \q(退出)
Bye

[root@localhost ~]# cd /mydata/data/(切换到/mysql/data目录)
[root@localhost data]# ls(查看当前目录文件及子目录)
cactidb  ibdata1      localhost.localdomain.err  mydb              mysql-bin.000012    studb     testdb
edb      ib_logfile0  localhost.localdomain.pid  mysql             mysql-bin.index     students
hellodb  ib_logfile1  localhost-slow.log         mysql-bin.000011  performance_schema  test

提示:这时候mysql-bin.000011都是我们过去一天的所有内容了,这是增量;

[root@localhost data]# cp mysql-bin.000011 /root/(复制mysql-bin.000011到/root目录)
[root@localhost data]# mysqlbinlog mysql-bin.000011 > /root/mon-incremental.sql(将mysql-bin.000011的内容保存到mon-incremental.sql文件中)

提示:这样才是最好的方式;

[root@localhost data]# mysql(连接mysql)
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 26
Server version: 5.5.28-log Source distribution

Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> USE studb;(修改默认数据库为studb)
Database changed

mysql> INSERT INTO tutors (Tname) VALUES ('stu123');(向tutors表Tname字段插入数据)
Query OK, 1 row affected (0.01 sec)

mysql> \q(退出)
Bye

[root@localhost data]# cp mysql-bin.000012 /root/(复制mysql-bin.000012到/root目录)
[root@localhost data]# rm -rf ./* (删除当前目录下所有文件)
[root@localhost data]# ls(查看当前目录文件及子目录)
[root@localhost data]# service mysqld stop(停止mysqld服务)
MySQL server PID file could not be found!                  [FAILED]
提示:无法停止mysqld服务;
[root@localhost data]# killall mysqld(杀死所有mysqld进程)
提示:现在千万不能试图启动mysqld
[root@localhost data]# cd(切换到用户家目录)
[root@localhost ~]# cd /usr/local/mysql/(切换到/usr/local/mysql目录)
[root@localhost mysql]# ls(查看当前目录文件及子目录)
bin  COPYING  data  docs  include  INSTALL-BINARY  lib  man  mysql-test  README  scripts  share  sql-bench  support-files
[root@localhost mysql]# scripts/mysql_install_db --user=mysql --datadir=/mydata/data/(初始化mysql,--user指定运行mysql用户,--datadir指定mysql
数据文件目录)
Installing MySQL system tables...
OK
Filling help tables...
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

./bin/mysqladmin -u root password 'new-password'
./bin/mysqladmin -u root -h localhost.localdomain password 'new-password'

Alternatively you can run:
./bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:
cd . ; ./bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd ./mysql-test ; perl mysql-test-run.pl

Please report any problems with the ./bin/mysqlbug script!

[root@localhost mysql]# service mysqld start(启动mysqld服务)
Starting MySQL...                                          [  OK  ]
[root@localhost mysql]# cd(切换到用户家目录)
[root@localhost ~]# ls(查看当前目录文件及子目录)
alldatabases.sql  cmake-2.8.8         jiaowu.sql           mysql-bin.000011               studb.sql
all.sql           cmake-2.8.8.tar.gz  mon-incremental.sql  mysql-bin.000012               test.sql
anaconda-ks.cfg   install.log         mysql-5.5.28         studb-2016-02-28-01-55-28.sql
a.sql             install.log.syslog  mysql-5.5.28.tar.gz  studb-2016-02-28-01-58-50.sql
[root@localhost ~]# mysql < alldatabases.sql(将alldatabases.sql的SQL脚步导入到mysql)
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
提示:拒绝使用root@localhost连接;
[root@localhost ~]# mysql -uroot -p < alldatabases.sql(将alldatabases.sql的SQL脚步导入到mysql)
Enter password: (密码为空)
提示:先还原完全备份;
[root@localhost ~]# ls -a(查看当前目录所有文件)
.                 .bash_history       .cshrc              jiaowu.sql           mysql-bin.000011               .subversion
..                .bash_logout        .gconf              .lesshst             mysql-bin.000012               .tcshrc
alldatabases.sql  .bash_profile       .gconfd             mon-incremental.sql  .mysql_history                 test.sql
all.sql           .bashrc             .gnome2             .my.cnf              studb-2016-02-28-01-55-28.sql  .viminfo
anaconda-ks.cfg   cmake-2.8.8         install.log         mysql-5.5.28         studb-2016-02-28-01-58-50.sql  .Xauthority
a.sql             cmake-2.8.8.tar.gz  install.log.syslog  mysql-5.5.28.tar.gz  studb.sql
提示:之所以不让我们访问是因为我们在当前目录下有一个隐藏文件叫.my.cnf,我们用不上它,传递的时候给它传递一个错误的;
[root@localhost ~]# mysql -uroot -p(连接mysql)             
Enter password: (密码空)
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.5.28-log Source distribution

Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> SELECT * FROM tutors;(查询tutors表中所有字段数据)
+-----+--------------+--------+------+
| TID | Tname        | Gender | Age  |
+-----+--------------+--------+------+
|   1 | HongQigong   | M      |   93 |
|   2 | HuangYaoshi  | M      |   63 |
|   3 | Miejueshitai | F      |   72 |
|   4 | OuYangfeng   | M      |   76 |
|   5 | YiDeng       | M      |   90 |
|   6 | YuCanghai    | M      |   56 |
|   7 | Jinlunfawang | M      |   67 |
|   8 | HuYidao      | M      |   42 |
|   9 | NingZhongze  | F      |   49 |
|  10 | Tom          | F      |   30 |
|  11 | DingDian     | M      |   25 |
|  12 | HuFei        | M      |   25 |
|  13 | stu100       | M      |   30 |
|  14 | hellodb      | M      | NULL |
+-----+--------------+--------+------+
14 rows in set (0.00 sec)

提示:Age大于80的两个用户都在;

mysql> \q(退出)
Bye

[root@localhost ~]# mysql -uroot -p < mon-incremental.sql(将mon-incremental.sql的SQL脚步导入到mysql)
Enter password: (密码空)

提示:还原第一次的增量备份;

[root@localhost ~]# mysql -uroot -p(连接mysql)
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 5.5.28-log Source distribution

Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> USE studb;(修改默认数据库为studb)
Database changed

mysql> SELECT * FROM tutors;(查询tutors表所有字段数据)
+-----+--------------+--------+------+
| TID | Tname        | Gender | Age  |
+-----+--------------+--------+------+
|   2 | HuangYaoshi  | M      |   63 |
|   3 | Miejueshitai | F      |   72 |
|   4 | OuYangfeng   | M      |   76 |
|   6 | YuCanghai    | M      |   56 |
|   7 | Jinlunfawang | M      |   67 |
|   8 | HuYidao      | M      |   42 |
|   9 | NingZhongze  | F      |   49 |
|  10 | Tom          | F      |   30 |
|  11 | DingDian     | M      |   25 |
|  12 | HuFei        | M      |   25 |
|  13 | stu100       | M      |   30 |
|  14 | hellodb      | M      | NULL |
+-----+--------------+--------+------+
12 rows in set (0.00 sec)

提示:Age大于80的没有了,还是没有还原到最后那一刻;

mysql> \q(退出)
Bye

[root@localhost ~]# mysqlbinlog mysql-bin.000012 > temp.sql(将mysql-bin.000012的内容保存到temp.sql文件)
[root@localhost ~]# mysql -uroot -p < temp.sql(将temp.sql的sql脚步导入到mysql)
Enter password: 
[root@localhost ~]# mysql -uroot -p(连接mysql)
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 12
Server version: 5.5.28-log Source distribution

Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> USE studb;(修改默认数据库为studb)
Database changed

mysql> SELECT * FROM tutors;(查询tutors表所有字段数据)
+-----+--------------+--------+------+
| TID | Tname        | Gender | Age  |
+-----+--------------+--------+------+
|   2 | HuangYaoshi  | M      |   63 |
|   3 | Miejueshitai | F      |   72 |
|   4 | OuYangfeng   | M      |   76 |
|   6 | YuCanghai    | M      |   56 |
|   7 | Jinlunfawang | M      |   67 |
|   8 | HuYidao      | M      |   42 |
|   9 | NingZhongze  | F      |   49 |
|  10 | Tom          | F      |   30 |
|  11 | DingDian     | M      |   25 |
|  12 | HuFei        | M      |   25 |
|  13 | stu100       | M      |   30 |
|  14 | hellodb      | M      | NULL |
|  15 | stu123       | M      | NULL |
+-----+--------------+--------+------+
13 rows in set (0.00 sec)

mysql> \q(退出)
Bye

提示:这样就还原到我们那一刻了;

二进制日志:

  format:

    statment 基于语句

    row 基于行的

    mixed 混合方式

mysqldump:

  3G

mysqldump:

  --databases DB1,DB2,... 备份指定数据库

  --all_databases 备份全部数据库

MyISAM: 温备份;

  --lock-all-tables 以只读方式锁定所有表

  --lock-table 以只读方式锁定某张表

InnoDB: 热备份

  --single-transaction 执行热备份,它会自动启动一个事务;

  --flush-logs 手动滚动一次二进制日志文件;

  --events 备份事件;

  --routines 备份存储过程和存储函数;

  -triggers 备份触发器;

  --master-data={0|1|2}

    0: 不记录二进制日志文件及其事件位置;

    1: 以CHANGE MASTER TO的方式记录位置,可用于恢复后直接启动从服务器;

    2: 以CHANGE MASTER TO的方式记录位置,但默认为被注释;

逻辑备份:

  1、浮点数据丢失精度

  2、备份出的数据更占用存储空间,压缩后可大大节省空间;

  3、不适合对达数据库做完全备份;

对InnoDB:

  mysql> FLUSH TABLES WITH READ LOCK;(刷新所有表并以只读方式加锁)

MVCC(多版本并发控制),REPEATABLE-READ

  --single-transaction

备份:

  SELECT * INTO OUTFILE '/path/to/somefile.txt' FROM tb_name [WHERE clause];(备份单张表的数据到系统文件,不保存表结构,恢复时候需要自己单独创建表结构)

还原:

  LOAD DATA INFILE '/path/to/somefile.txt' INTO TABLE tb_name;(使用备份的系统文件还原表的数据,表结构需要自己事先创建)

几乎热备: LVM

  snapshot: 快照

  前提:

    1、数据文件要在逻辑卷上;

    2、此逻辑卷所在卷组必须有足够空间使用快照卷;

    3、数据文件和事务日志要在同一个逻辑卷上;

  步骤:

    1、打开会话,施加读锁,锁定所有表;

      mysql> FLUSH TABLES WITH READ LOCK;

      mysql> FLUSH LOGS;

    2、通过另一个终端,保存二进制日志文件及相关位置信息;

      $ mysql -uroot -p -e 'SHOW MASTER STATUS\G' > /path/to/master.info

    3、创建快照卷

      $ lvcreate -L # -s -p r -n LV_NAME /path/to/source_lv

    4、释放锁

      mysql> UNLOCK TABLES;

    5、挂在快照卷,备份

      mount

      cp

    6、删除快照卷;

    7、增量备份二进制日志;

SELECT INTO OUTFILE(SELECT把一个表备份成使用SELECT看到的样子)

You can use the INTO OUTFILE clause of the SELECT statement to back up individual tables on a server

The command used to load the dump created is LOAD DATA INFILE

  SELECT * INTO OUTFILE '/tmp/t1.txt' FROM t1;(备份单张表到文本文件中,OUTFILE /tmp/t1.txt保存到文件系统上文件,FROM t1保存那张表)

  LOAD DATA INFILE '/tmp/t1.txt' INTO TABLE t1;(通过那个文件来载入文件,并且名且说明载入到表中去,这个表格式我们的事先创建好)


事务日志结合数据文件一块来完成数据管理,所以用户的所有的写操作是先写到日志中来,它会一条条往数据文件中同步的,所以说我们在创建快照的时候,比如执行了FLUSH TABLES WITH READ LOCK;执行这个命令之后,我们就锁定所有表了,其它用户都不能往里面写了,这并不意味着数据文件跟事务日志已经统一了,这也就意味着我们事务日志中的某些语句在后台仍然往数据文件中写,他们俩仍然在做同步,如果把它俩放在不同的卷上分别进行快照,那么快照的时间点有可能不一致,不一致的话,那我们的事务日志就无法向数据文件同步数据,由此我们必须要把它俩放在同一个卷上,这样子我们对同一个卷做快照的时候,那么它俩快照的时间点就一致了,在我们做快照那一刻仍然有可能正在将数据通过事务日志同步到数据文件中去,仍然有写操作的,这个时候它正在背后写,突然给它做个快照,这个快照有用,我们在快照中复制的数据一定是包含事务日志和数据文件的,可以用来还原,可以拿来还原也就意味着有些数据仍然在事务日志当中还没有写到数据文件,能用来进行还原,只不过MySQL数据库服务器要对它做一次内在的修复操作,我们突然间给它做一个快照类似于MySQL服务器突然间掉电了,因为它正在写的过程中突然间断开了,因为通过快照所访问的数据就是突然间断开那一刻的数据,所以在MySQL服务器看来,将来我们拿这个备份的数据去恢复的时候,这就是一个突然间数据库发生崩溃事件的,需要还原的一个版本,那也就意味着MySQL服务器只要能够将它还原回来就可以了,同样道理,将来我们要想实现将那些未执行完成的操作继续执行的话,比如我们做了快照以后又让服务器上线,此后其它用户可以继续写操作了,这个继续执行的写操作仍然有可能需要像数据文件和事务文件写数据,这些操作也会同时记录到二进制日志文件,将来要做即时点还原的话,还要依赖二进制日志,因此就算我们使用逻辑卷做一次物理的完全备份,将来做即时点还原仍然依赖于二进制日志;

mysql> SHOW GLOBAL VARIABLES LIKE '%log%';(查看mysql全局变量中间包含log相关的变量值)
+-----------------------------------------+----------------------------------------+
| Variable_name                           | Value                                  |
+-----------------------------------------+----------------------------------------+
| back_log                                | 50                                     |
| binlog_cache_size                       | 32768                                  |
| binlog_direct_non_transactional_updates | OFF                                    |
| binlog_format                           | MIXED                                  |
| binlog_stmt_cache_size                  | 32768                                  |
| expire_logs_days                        | 0                                      |
| general_log                             | OFF                                    |
| general_log_file                        | /mydata/data/localhost.log             |
| innodb_flush_log_at_trx_commit          | 1                                      |
| innodb_locks_unsafe_for_binlog          | OFF                                    |
| innodb_log_buffer_size                  | 8388608                                |
| innodb_log_file_size                    | 5242880                                |
| innodb_log_files_in_group               | 2                                      |
| innodb_log_group_home_dir               | ./                                     |
| innodb_mirrored_log_groups              | 1                                      |
| log                                     | OFF                                    |
| log_bin                                 | ON                                     |
| log_bin_trust_function_creators         | OFF                                    |
| log_error                               | /mydata/data/localhost.localdomain.err |
| log_output                              | FILE                                   |
| log_queries_not_using_indexes           | OFF                                    |
| log_slave_updates                       | OFF                                    |
| log_slow_queries                        | OFF                                    |
| log_warnings                            | 1                                      |
| max_binlog_cache_size                   | 18446744073709547520                   |
| max_binlog_size                         | 1073741824                             |
| max_binlog_stmt_cache_size              | 18446744073709547520                   |
| max_relay_log_size                      | 0                                      |
| relay_log                               |                                        |
| relay_log_index                         |                                        |
| relay_log_info_file                     | relay-log.info                         |
| relay_log_purge                         | ON                                     |
| relay_log_recovery                      | OFF                                    |
| relay_log_space_limit                   | 0                                      |
| slow_query_log                          | OFF                                    |
| slow_query_log_file                     | /mydata/data/localhost-slow.log        |
| sql_log_bin                             | ON                                     |
| sql_log_off                             | OFF                                    |
| sync_binlog                             | 0                                      |
| sync_relay_log                          | 0                                      |
| sync_relay_log_info                     | 0                                      |
+-----------------------------------------+----------------------------------------+
41 rows in set (0.00 sec)
   
提示:sql_log_bin是否记录二进制日志,而且对当前会话来讲改成OFF它就不会记录二进制日志了;

mysql> SHOW MASTER STATUS;(查看当前使用的二进制日志文件)
+------------------+----------+--------------+------------------+
| File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+------------------+----------+--------------+------------------+
| mysql-bin.000006 |      107 |              |                  |
+------------------+----------+--------------+------------------+
1 row in set (0.00 sec)

mysql> CREATE DATABASE mydb;(创建mydb数据库)
Query OK, 1 row affected (0.00 sec)

mysql> SHOW MASTER STATUS;(查看当前使用的二进制日志文件)
+------------------+----------+--------------+------------------+
| File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+------------------+----------+--------------+------------------+
| mysql-bin.000006 |      190 |              |                  |
+------------------+----------+--------------+------------------+
1 row in set (0.00 sec)

mysql> SHOW BINLOG EVENTS IN 'mysql-bin.000006';(查看二进制日志文件事件内容)
+------------------+-----+-------------+-----------+-------------+---------------------------------------+
| Log_name         | Pos | Event_type  | Server_id | End_log_pos | Info                                  |
+------------------+-----+-------------+-----------+-------------+---------------------------------------+
| mysql-bin.000006 |   4 | Format_desc |         1 |         107 | Server ver: 5.5.28-log, Binlog ver: 4 |
| mysql-bin.000006 | 107 | Query       |         1 |         190 | CREATE DATABASE mydb                  |
+------------------+-----+-------------+-----------+-------------+---------------------------------------+
2 rows in set (0.00 sec)

提示:现在是记录的;

mysql> SET sql_log_bin=0; (关闭记录二进制日志)
Query OK, 0 rows affected (0.00 sec)

提示:sql_log_bin=[0|1] 1表ON,0表示OFF;

mysql> CREATE DATABASE hellodb;(创建数据库hellodb)
Query OK, 1 row affected (0.00 sec)

mysql> SHOW BINLOG EVENTS IN 'mysql-bin.000006';(查看二进制日志文件事件内容)
+------------------+-----+-------------+-----------+-------------+---------------------------------------+
| Log_name         | Pos | Event_type  | Server_id | End_log_pos | Info                                  |
+------------------+-----+-------------+-----------+-------------+---------------------------------------+
| mysql-bin.000006 |   4 | Format_desc |         1 |         107 | Server ver: 5.5.28-log, Binlog ver: 4 |
| mysql-bin.000006 | 107 | Query       |         1 |         190 | CREATE DATABASE mydb                  |
+------------------+-----+-------------+-----------+-------------+---------------------------------------+
2 rows in set (0.00 sec)

提示:创建hellodb没有记录进入二进制日志文件;

mysql> SET sql_log_bin=1;(启用二进制记录日志文件)
Query OK, 0 rows affected (0.00 sec)

mysql> DROP DATABASE hellodb;(删除数据库hellodb)
Query OK, 0 rows affected (0.00 sec)

mysql> SHOW BINLOG EVENTS IN 'mysql-bin.000006';(查看二进制日志文件事件内容)
+------------------+-----+-------------+-----------+-------------+---------------------------------------+
| Log_name         | Pos | Event_type  | Server_id | End_log_pos | Info                                  |
+------------------+-----+-------------+-----------+-------------+---------------------------------------+
| mysql-bin.000006 |   4 | Format_desc |         1 |         107 | Server ver: 5.5.28-log, Binlog ver: 4 |
| mysql-bin.000006 | 107 | Query       |         1 |         190 | CREATE DATABASE mydb                  |
| mysql-bin.000006 | 190 | Query       |         1 |         277 | DROP DATABASE hellodb                 |
+------------------+-----+-------------+-----------+-------------+---------------------------------------+
3 rows in set (0.00 sec)

提示:DROP DATABASE hellod记录进入二进制日志文件,以后使用mysqldump备份出数据再还原的时候要临时性的关闭记录二进制日志;

mysql> \q(退出)
Bye

假如有一个jiaowu的数据库,现在要把它还原回来,但在还原过程中我们又不期望开启二进制日志;

[root@localhost ~]# lftp 172.16.0.1(连接ftp服务器)
lftp 172.16.0.1:~> cd pub/Files(切换到/pub/Files目录)
cd ok, cwd=/pub/Files
lftp 172.16.0.1:/pub/Files> get jiaowu.sql(下载jiaowu.sql脚步)
5276 bytes transferred
lftp 172.16.0.1:/pub/Files> bye(退出)
[root@localhost ~]# ls(查看当前目录文件及子目录)
alldatabases.sql  cmake-2.8.8         jiaowu.sql           mysql-bin.000011               studb.sql
all.sql           cmake-2.8.8.tar.gz  mon-incremental.sql  mysql-bin.000012               temp.sql
anaconda-ks.cfg   install.log         mysql-5.5.28         studb-2016-02-28-01-55-28.sql  test.sql
a.sql             install.log.syslog  mysql-5.5.28.tar.gz  studb-2016-02-28-01-58-50.sql
[root@localhost ~]# mysql -uroot -p(连接mysql)
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 15
Server version: 5.5.28-log Source distribution

Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> SELECT @@sql_log_bin;(查看sql_log_bin变量值)
+---------------+
| @@sql_log_bin |
+---------------+
|             1 |
+---------------+
1 row in set (0.00 sec)

mysql> SET sql_log_bin=0;(关闭记录二进制日志文件)
Query OK, 0 rows affected (0.00 sec)

提示:千万不了再启动一个mysql会话,使用mysql语句直接导入,那也是不可以的,跟当前会话就没有关系了;

mysql> \. /root/jiaowu.sql(将jiaowu.sql脚本导入到mysql,使用SOURCE也行)
Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 1 row affected (0.00 sec)

Database changed
Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.41 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 10 rows affected (0.00 sec)
Records: 10  Duplicates: 0  Warnings: 0

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.02 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.01 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 8 rows affected (0.00 sec)
Records: 8  Duplicates: 0  Warnings: 0

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.01 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 10 rows affected (0.00 sec)
Records: 10  Duplicates: 0  Warnings: 0

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.01 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 9 rows affected (0.00 sec)
Records: 9  Duplicates: 0  Warnings: 0

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

mysql> SHOW DATABASES;(显示数据库)
+--------------------+
| Database           |
+--------------------+
| information_schema |
| jiaowu             |
| mydb               |
| mysql              |
| performance_schema |
| test               |
+--------------------+
6 rows in set (0.00 sec)

mysql> USE jiaowu;(修改默认数据库为jiaowu)
Database changed

mysql> SHOW TABLES;(查看当前数据库所有表)
+------------------+
| Tables_in_jiaowu |
+------------------+
| courses          |
| scores           |
| students         |
| tutors           |
+------------------+
4 rows in set (0.00 sec)

mysql> SELECT * FROM tutors;(查询tutors表中所有字段数据)
+-----+--------------+--------+------+
| TID | Tname        | Gender | Age  |
+-----+--------------+--------+------+
|   1 | HongQigong   | M      |   93 |
|   2 | HuangYaoshi  | M      |   63 |
|   3 | Miejueshitai | F      |   72 |
|   4 | OuYangfeng   | M      |   76 |
|   5 | YiDeng       | M      |   90 |
|   6 | YuCanghai    | M      |   56 |
|   7 | Jinlunfawang | M      |   67 |
|   8 | HuYidao      | M      |   42 |
|   9 | NingZhongze  | F      |   49 |
+-----+--------------+--------+------+
9 rows in set (0.00 sec)

mysql> SET sql_log_bin=1;(打开记录二进制日志文件)
Query OK, 0 rows affected (0.00 sec)
mysql> SHOW ENGINE INNODB STATUS;(查看innodb存储引擎存储状态)
+--------+------+--------------------------------------------------------------------------------------------------------------------------+
| Type   | Name | Status                                                                                                                   |
+--------+------+--------------------------------------------------------------------------------------------------------------------------+
=====================================
160228  5:45:18 INNODB MONITOR OUTPUT
=====================================
Per second averages calculated from the last 9 seconds
-----------------
BACKGROUND THREAD
-----------------
srv_master_thread loops: 13 1_second, 13 sleeps, 1 10_second, 4 background, 4 flush
srv_master_thread log flush and writes: 13
----------
SEMAPHORES
----------
OS WAIT ARRAY INFO: reservation count 8, signal count 8
Mutex spin waits 6, rounds 180, OS waits 0
RW-shared spins 8, rounds 240, OS waits 8
RW-excl spins 0, rounds 0, OS waits 0
Spin rounds per wait: 30.00 mutex, 30.00 RW-shared, 0.00 RW-excl
------------
TRANSACTIONS
------------
Trx id counter 30A
Purge done for trx's n:o < 0 undo n:o < 0
History list length 0
LIST OF TRANSACTIONS FOR EACH SESSION:
---TRANSACTION 0, not started
MySQL thread id 5, OS thread handle 0x95388b90, query id 166 localhost root
SHOW ENGINE INNODB STATUS
--------
FILE I/O
--------
I/O thread 0 state: waiting for i/o request (insert buffer thread)
I/O thread 1 state: waiting for i/o request (log thread)
I/O thread 2 state: waiting for i/o request (read thread)
I/O thread 3 state: waiting for i/o request (read thread)
I/O thread 4 state: waiting for i/o request (read thread)
I/O thread 5 state: waiting for i/o request (read thread)
I/O thread 6 state: waiting for i/o request (write thread)
I/O thread 7 state: waiting for i/o request (write thread)
I/O thread 8 state: waiting for i/o request (write thread)
I/O thread 9 state: waiting for i/o request (write thread)
Pending normal aio reads: 0 [0, 0, 0, 0] , aio writes: 0 [0, 0, 0, 0] ,
 ibuf aio reads: 0, log i/o's: 0, sync i/o's: 0
Pending flushes (fsync) log: 0; buffer pool: 0
0 OS file reads, 86 OS file writes, 47 OS fsyncs
0.00 reads/s, 0 avg bytes/read, 0.00 writes/s, 0.00 fsyncs/s
-------------------------------------
INSERT BUFFER AND ADAPTIVE HASH INDEX
-------------------------------------
Ibuf: size 1, free list len 0, seg size 2, 0 merges
merged operations:
 insert 0, delete mark 0, delete 0
discarded operations:
 insert 0, delete mark 0, delete 0
Hash table size 553193, node heap has 1 buffer(s)
0.00 hash searches/s, 0.00 non-hash searches/s
---
LOG
---
Log sequence number 1617865
Log flushed up to   1617865
Last checkpoint at  1617865
0 pending log writes, 0 pending chkp writes
20 log i/o's done, 0.00 log i/o's/second
----------------------
BUFFER POOL AND MEMORY
----------------------
Total memory allocated 136675328; in additional pool allocated 0
Dictionary memory allocated 32493
Buffer pool size   8191
Free buffers       7860
Database pages     330
Old database pages 0
Modified db pages  0
Pending reads 0
Pending writes: LRU 0, flush list 0, single page 0
Pages made young 0, not young 0
0.00 youngs/s, 0.00 non-youngs/s
Pages read 0, created 330, written 357
0.00 reads/s, 0.00 creates/s, 0.00 writes/s
No buffer pool page gets since the last printout
Pages read ahead 0.00/s, evicted without access 0.00/s, Random read ahead 0.00/s
LRU len: 330, unzip_LRU len: 0
I/O sum[0]:cur[0], unzip sum[0]:cur[0]
--------------
ROW OPERATIONS
--------------
0 queries inside InnoDB, 0 queries in queue
1 read views open inside InnoDB
Main thread process no. 13187, id 2514201488, state: waiting for server activity
Number of rows inserted 37, updated 0, deleted 0, read 9
0.00 inserts/s, 0.00 updates/s, 0.00 deletes/s, 0.00 reads/s
----------------------------
END OF INNODB MONITOR OUTPUT
============================
|
+--------+------+--------------------------------------------------------------------------------------------------------------------------+
提示:这些信息如果在某些地方在I/O上仍然在执行写操作就需要等待了,我们的buffer中仍然有大小,尤其是写buffer中仍然有大小,也需要等待,我们必须要观察这边发现我们的缓
冲中没有数据以后才能开始执行mysqldump写操作的,因此建议对Innodb存储引擎做热备;

mysql> SELECT * FROM tutors;(查看tutors表所有字段数据)
+-----+--------------+--------+------+
| TID | Tname        | Gender | Age  |
+-----+--------------+--------+------+
|   1 | HongQigong   | M      |   93 |
|   2 | HuangYaoshi  | M      |   63 |
|   3 | Miejueshitai | F      |   72 |
|   4 | OuYangfeng   | M      |   76 |
|   5 | YiDeng       | M      |   90 |
|   6 | YuCanghai    | M      |   56 |
|   7 | Jinlunfawang | M      |   67 |
|   8 | HuYidao      | M      |   42 |
|   9 | NingZhongze  | F      |   49 |
+-----+--------------+--------+------+
9 rows in set (0.00 sec)

提示:SELECT备份出来的数据除了表边框之外里面的所有信息都直接备份成一个文本文件,而且各字段之间也是使用字符隔开的;

mysql> SELECT * INTO OUTFILE '/tmp/tutor.txt' FROM tutors;(保存tutors表到系统上/tmp目录下叫tutor.txt文本)
Query OK, 9 rows affected (0.04 sec)

[root@localhost ~]# cd /tmp/(切换到/tmp目录)
[root@localhost tmp]# ls(查看当前目录文件及子目录)
mapping-Smoke  mysql.sock  scim-panel-socket:0-Smoke  tutor.txt
[root@localhost tmp]# cat tutor.txt(查看tutor.txt文件内容)
1	HongQigong	M	93
2	HuangYaoshi	M	63
3	Miejueshitai	F	72
4	OuYangfeng	M	76
5	YiDeng	M	90
6	YuCanghai	M	56
7	Jinlunfawang	M	67
8	HuYidao	M	42
9	NingZhongze	F	49

提示:所以它没有保存任何额外的SQL语句,纯粹就是放在表中的数据,各字段之间使用制表符(tab键)分割,将来我们要恢复这个数据的话,只能使用与之匹配的命令LOAD DATA 
INFILE;

mysql> CREATE TABLE tutor LIKE tutors;(以tutors表为模版创建tutor空表)
Query OK, 0 rows affected (0.03 sec)

mysql> DESC tutor;(查看tutor表结构)
+--------+----------------------+------+-----+---------+----------------+
| Field  | Type                 | Null | Key | Default | Extra          |
+--------+----------------------+------+-----+---------+----------------+
| TID    | smallint(5) unsigned | NO   | PRI | NULL    | auto_increment |
| Tname  | varchar(50)          | NO   |     | NULL    |                |
| Gender | enum('F','M')        | YES  |     | M       |                |
| Age    | tinyint(3) unsigned  | YES  |     | NULL    |                |
+--------+----------------------+------+-----+---------+----------------+
4 rows in set (0.00 sec)

mysql> DESC tutors;(查看tutors表结构)
+--------+----------------------+------+-----+---------+----------------+
| Field  | Type                 | Null | Key | Default | Extra          |
+--------+----------------------+------+-----+---------+----------------+
| TID    | smallint(5) unsigned | NO   | PRI | NULL    | auto_increment |
| Tname  | varchar(50)          | NO   |     | NULL    |                |
| Gender | enum('F','M')        | YES  |     | M       |                |
| Age    | tinyint(3) unsigned  | YES  |     | NULL    |                |
+--------+----------------------+------+-----+---------+----------------+
4 rows in set (0.00 sec)

提示:tutor和totors表格式相同;

mysql> DROP TABLE tutors;(删除tutors表)
Query OK, 0 rows affected (0.01 sec)

mysql> SELECT * FROM tutor;(查看tutor表所有字段数据)
Empty set (0.00 sec)

mysql> LOAD DATA INFILE '/tmp/tutor.txt' INTO TABLE tutor;(将tutor.txt文件数据导入到tutor表中去)
Query OK, 9 rows affected (0.01 sec)
Records: 9  Deleted: 0  Skipped: 0  Warnings: 0

mysql> SELECT * FROM tutor;(查看tutor表所有字段数据)
+-----+--------------+--------+------+
| TID | Tname        | Gender | Age  |
+-----+--------------+--------+------+
|   1 | HongQigong   | M      |   93 |
|   2 | HuangYaoshi  | M      |   63 |
|   3 | Miejueshitai | F      |   72 |
|   4 | OuYangfeng   | M      |   76 |
|   5 | YiDeng       | M      |   90 |
|   6 | YuCanghai    | M      |   56 |
|   7 | Jinlunfawang | M      |   67 |
|   8 | HuYidao      | M      |   42 |
|   9 | NingZhongze  | F      |   49 |
+-----+--------------+--------+------+
9 rows in set (0.00 sec)

提示:使用SELECT备份的时候在FROM语句后面还可以加上WHERE子句,只备份这个表中某些个符合条件的数据也完全可以的,比如就期望把这个表中符合条件的数据给它取出来保存在另
外一个数据库的另外一张表中去的时候,使用这种方式是非常有用的,这也是一种逻辑备份,这种备份方式所备份出来的数据它不需要重写为SQL语句,所以速度要比mysqldump要快,但
是我们只能一张表一张表的写,所以备份起来我们要单独进程管理,这比较麻烦,自己要确保他们在时间上刚好是一致的,它比mysqldump的备份更节约空间,还原的速度也会更快,但
是通常我们不拿它来做完全备份,只拿它来做某单张表的备份;

mysql> SHOW BINLOG EVENTS IN 'mysql-bin.000003';(查看二进制日志文件事件内容)
+------------------+-----+-------------+-----------+-------------+-------------------------------------------------------------+
| Log_name         | Pos | Event_type  | Server_id | End_log_pos | Info                                                        |
+------------------+-----+-------------+-----------+-------------+-------------------------------------------------------------+
| mysql-bin.000003 |   4 | Format_desc |         1 |         107 | Server ver: 5.5.28-log, Binlog ver: 4                       |
| mysql-bin.000003 | 107 | Query       |         1 |         202 | use `jiaowu`; CREATE TABLE tutor LIKE tutors                |
| mysql-bin.000003 | 202 | Query       |         1 |         312 | use `jiaowu`; DROP TABLE `tutors` /* generated by server */ |
| mysql-bin.000003 | 312 | Query       |         1 |         382 | BEGIN                                                       |
| mysql-bin.000003 | 382 | Table_map   |         1 |         435 | table_id: 44 (jiaowu.tutor)                                 |
| mysql-bin.000003 | 435 | Write_rows  |         1 |         606 | table_id: 44 flags: STMT_END_F                              |
| mysql-bin.000003 | 606 | Xid         |         1 |         633 | COMMIT /* xid=195 */                                        |
+------------------+-----+-------------+-----------+-------------+-------------------------------------------------------------+
7 rows in set (0.00 sec)

提示:使用 LOAD DATA INFILE '/tmp/tutor.txt' INTO TABLE tutor;恢复表没有写进二进制日志文件,因为执行的不是DML语句;

mysql> \q(退出)
Bye

[root@localhost ~]# mysqlbinlog /mydata/data/mysql-bin.000003(查看mysql-bin.000003的内容) 
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
# at 4
#160228  5:10:59 server id 1  end_log_pos 107 	Start: binlog v 4, server v 5.5.28-log created 160228  5:10:59 at startup
# Warning: this binlog is either in use or was not closed properly.
ROLLBACK/*!*/;
BINLOG '
4xDSVg8BAAAAZwAAAGsAAAABAAQANS41LjI4LWxvZwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAADjENJWEzgNAAgAEgAEBAQEEgAAVAAEGggAAAAICAgCAA==
'/*!*/;
# at 107
#160228  6:34:35 server id 1  end_log_pos 202 	Query	thread_id=5	exec_time=0	error_code=0
use jiaowu/*!*/;
SET TIMESTAMP=1456612475/*!*/;
SET @@session.pseudo_thread_id=5/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
CREATE TABLE tutor LIKE tutors
/*!*/;
# at 202
#160228  6:38:56 server id 1  end_log_pos 312 	Query	thread_id=6	exec_time=0	error_code=0
SET TIMESTAMP=1456612736/*!*/;
DROP TABLE `tutors` /* generated by server */
/*!*/;
# at 312
#160228  6:40:08 server id 1  end_log_pos 382 	Query	thread_id=6	exec_time=0	error_code=0
SET TIMESTAMP=1456612808/*!*/;
BEGIN
/*!*/;
# at 382
# at 435
#160228  6:40:08 server id 1  end_log_pos 435 	Table_map: `jiaowu`.`tutor` mapped to number 44
#160228  6:40:08 server id 1  end_log_pos 606 	Write_rows: table id 44 flags: STMT_END_F

BINLOG '
yCXSVhMBAAAANQAAALMBAAAAACwAAAAAAAEABmppYW93dQAFdHV0b3IABAIP/gEEMgD3AQw=
yCXSVhcBAAAAqwAAAF4CAAAAACwAAAAAAAEABP/wAQAKSG9uZ1FpZ29uZwJd8AIAC0h1YW5nWWFv
c2hpAj/wAwAMTWllanVlc2hpdGFpAUjwBAAKT3VZYW5nZmVuZwJM8AUABllpRGVuZwJa8AYACVl1
Q2FuZ2hhaQI48AcADEppbmx1bmZhd2FuZwJD8AgAB0h1WWlkYW8CKvAJAAtOaW5nWmhvbmd6ZQEx
'/*!*/;
# at 606
#160228  6:40:08 server id 1  end_log_pos 633 	Xid = 195
COMMIT/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;

[root@localhost ~]# mysqlbinlog --start-position=435 /mydata/data/mysql-bin.000003(查看mysql-bin.000003二进制文件内容,--start-position起始
位置) 
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
# at 4
#160228  5:10:59 server id 1  end_log_pos 107 	Start: binlog v 4, server v 5.5.28-log created 160228  5:10:59 at startup
# Warning: this binlog is either in use or was not closed properly.
ROLLBACK/*!*/;
BINLOG '
4xDSVg8BAAAAZwAAAGsAAAABAAQANS41LjI4LWxvZwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAADjENJWEzgNAAgAEgAEBAQEEgAAVAAEGggAAAAICAgCAA==
'/*!*/;
# at 435
#160228  6:40:08 server id 1  end_log_pos 606 	Write_rows: table id 44 flags: STMT_END_F

BINLOG '
yCXSVhcBAAAAqwAAAF4CAAAAACwAAAAAAAEABP/wAQAKSG9uZ1FpZ29uZwJd8AIAC0h1YW5nWWFv
c2hpAj/wAwAMTWllanVlc2hpdGFpAUjwBAAKT3VZYW5nZmVuZwJM8AUABllpRGVuZwJa8AYACVl1
Q2FuZ2hhaQI48AcADEppbmx1bmZhd2FuZwJD8AgAB0h1WWlkYW8CKvAJAAtOaW5nWmhvbmd6ZQEx
'/*!*/;
# at 606
#160228  6:40:08 server id 1  end_log_pos 633 	Xid = 195
COMMIT/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;

[root@localhost ~]# mysqlbinlog --start-position=435 /mydata/data/mysql-bin.000003 > /root/a.sql(查看mysql-bin.000003二进制文件内容并保存到
/root目录叫a.sql,--start-position起始位置)

[root@localhost ~]# mysql(连接mysql)
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 5.5.28-log Source distribution

Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> USE jiaowu;(修改默认数据库为jiaowu)
Database changed

mysql> CREATE TABLE tutors LIKE tutor;(以tutor表为模版创建tutors空表)
Query OK, 0 rows affected (0.01 sec)

mysql> TRUNCATE TABLE tutor;(情况tutor表的数据,并且重置AUTOINCREMENT(自动增长)计算器)
Query OK, 0 rows affected (0.01 sec)

mysql> SELECT * FROM tutor;(查看tutor表所有字段数据)
Empty set (0.00 sec)

mysql> SELECT * FROM tutors;(查看tutors表所有字段数据)
Empty set (0.00 sec)

mysql> SET sql_log_bin=0;(关闭记录二进制日志)
Query OK, 0 rows affected (0.00 sec)

mysql> SOURCE /root/a.sql;(将a.sql脚步导入到mysql,使用\.也行)
Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

mysql> SELECT * FROM tutor;(查看tutor表所有字段数据)
Empty set (0.00 sec)

mysql> SELECT * FROM tutors;(查看tutors表所有字段数据)
Empty set (0.00 sec)

mysql> SHOW TABLES;(显示当前库的表)
+------------------+
| Tables_in_jiaowu |
+------------------+
| courses          |
| scores           |
| students         |
| tutor            |
| tutors           |
+------------------+
5 rows in set (0.00 sec)

[root@localhost ~]# vim a.sql(编辑a.sql脚步)

/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
# at 4
#160228  5:10:59 server id 1  end_log_pos 107   Start: binlog v 4, server v 5.5.28-log created 160228  5:10:59 at startup
# Warning: this binlog is either in use or was not closed properly.(出故障了)
ROLLBACK/*!*/;
BINLOG '
4xDSVg8BAAAAZwAAAGsAAAABAAQANS41LjI4LWxvZwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAADjENJWEzgNAAgAEgAEBAQEEgAAVAAEGggAAAAICAgCAA==
'/*!*/;
# at 435
#160228  6:40:08 server id 1  end_log_pos 606   Write_rows: table id 44 flags: STMT_END_F

BINLOG '
yCXSVhcBAAAAqwAAAF4CAAAAACwAAAAAAAEABP/wAQAKSG9uZ1FpZ29uZwJd8AIAC0h1YW5nWWFv
c2hpAj/wAwAMTWllanVlc2hpdGFpAUjwBAAKT3VZYW5nZmVuZwJM8AUABllpRGVuZwJa8AYACVl1
Q2FuZ2hhaQI48AcADEppbmx1bmZhd2FuZwJD8AgAB0h1WWlkYW8CKvAJAAtOaW5nWmhvbmd6ZQEx
'/*!*/;
# at 606
#160228  6:40:08 server id 1  end_log_pos 633   Xid = 195
COMMIT/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;

[root@localhost ~]# cd /mydata/data/(切换到/mydata/data目录)
[root@localhost data]# ls(查看当前目录文件及子目录)
ibdata1      ib_logfile1  localhost.localdomain.err  mydb   mysql-bin.000001  mysql-bin.000003  performance_schema
ib_logfile0  jiaowu       localhost.localdomain.pid  mysql  mysql-bin.000002  mysql-bin.index   test
[root@localhost data]# tail localhost.localdomain.err(查看mysql错误日志后10行) 
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
160228  5:10:58  InnoDB: Waiting for the background threads to start
160228  5:10:59 InnoDB: 1.1.8 started; log sequence number 0
160228  5:10:59 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
160228  5:10:59 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
160228  5:10:59 [Note] Server socket created on IP: '0.0.0.0'.
160228  5:10:59 [Note] Event Scheduler: Loaded 0 events
160228  5:10:59 [Note] /usr/local/mysql/bin/mysqld: ready for connections.
Version: '5.5.28-log'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution
[root@localhost data]# pwd(显示当前所处路径)
/mydata/data
[root@localhost data]# ls(查看当前目录文件及子目录)
ibdata1      ib_logfile1  localhost.localdomain.err  mydb   mysql-bin.000001  mysql-bin.000003  performance_schema
ib_logfile0  jiaowu       localhost.localdomain.pid  mysql  mysql-bin.000002  mysql-bin.index   test
[root@localhost data]# mysql(连接mysql数据库)
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 5.5.28-log Source distribution

Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> FLUSH LOGS;(手动滚动一次二进制日志文件)
Query OK, 0 rows affected (0.01 sec)

mysql> \q(退出)
Bye

[root@localhost data]# ls(查看当前目录文件及子目录)
ibdata1      ib_logfile1  localhost.localdomain.err  mydb   mysql-bin.000001  mysql-bin.000003  mysql-bin.index     test
ib_logfile0  jiaowu       localhost.localdomain.pid  mysql  mysql-bin.000002  mysql-bin.000004  performance_schema

[root@localhost ~]# mysqlbinlog --start-position=435 /mydata/data/mysql-bin.000003 > /root/a.sql(查看mysql-bin.000003二进制文件内容并保存到
/root目录叫a.sql,--start-position起始位置)
[root@localhost data]# vim /root/a.sql(编辑a.sql文件)

/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
# at 4
#160228  5:10:59 server id 1  end_log_pos 107   Start: binlog v 4, server v 5.5.28-log created 160228  5:10:59 at startup
ROLLBACK/*!*/;
BINLOG '
4xDSVg8BAAAAZwAAAGsAAAAAAAQANS41LjI4LWxvZwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAADjENJWEzgNAAgAEgAEBAQEEgAAVAAEGggAAAAICAgCAA==
'/*!*/;
# at 435
#160228  6:40:08 server id 1  end_log_pos 606   Write_rows: table id 44 flags: STMT_END_F

BINLOG '
yCXSVhcBAAAAqwAAAF4CAAAAACwAAAAAAAEABP/wAQAKSG9uZ1FpZ29uZwJd8AIAC0h1YW5nWWFv
c2hpAj/wAwAMTWllanVlc2hpdGFpAUjwBAAKT3VZYW5nZmVuZwJM8AUABllpRGVuZwJa8AYACVl1
Q2FuZ2hhaQI48AcADEppbmx1bmZhd2FuZwJD8AgAB0h1WWlkYW8CKvAJAAtOaW5nWmhvbmd6ZQEx
'/*!*/;
# at 606
#160228  6:40:08 server id 1  end_log_pos 633   Xid = 195
COMMIT/*!*/;
# at 633
#160228  7:36:10 server id 1  end_log_pos 728   Query   thread_id=7     exec_time=0     error_code=0
use jiaowu/*!*/;
SET TIMESTAMP=1456616170/*!*/;
SET @@session.pseudo_thread_id=7/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
CREATE TABLE tutors LIKE tutor
/*!*/;
# at 728
#160228  7:37:12 server id 1  end_log_pos 813   Query   thread_id=7     exec_time=0     error_code=0
SET TIMESTAMP=1456616232/*!*/;
TRUNCATE TABLE tutor
/*!*/;
# at 813
#160228  7:52:42 server id 1  end_log_pos 856   Rotate to mysql-bin.000004  pos: 4
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;

提示:这次没有警告信息;

mysql> SOURCE /root/a.sql;(将a.sql脚步导入到mysql,使用\.也行)
Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.01 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Database changed
Query OK, 0 rows affected (0.01 sec)

Query OK, 0 rows affected (0.01 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Charset changed
Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

ERROR 1050 (42S01): Table 'tutors' already exists
Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.02 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

mysql> SELECT * FROM tutor;(查看表tutor表所有字段数据)
Empty set (0.00 sec)

mysql> SELECT * FROM tutors;(查看表tutors表所有字段数据)
Empty set (0.00 sec)

mysql> \q(退出)
Bye

[root@localhost data]# cd(切换到用户家目录)
[root@localhost ~]# mysql(连接mysql数据库)
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 5.5.28-log Source distribution

Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> USE jiaowu;(修改默认数据库为jiaowu)
Database changed
mysql> SHOW TABLES;(显示当前库表)
+------------------+
| Tables_in_jiaowu |
+------------------+
| courses          |
| scores           |
| students         |
| tutor            |
| tutors           |
+------------------+
5 rows in set (0.00 sec)

mysql> DROP TABLE tutor;(删除tutor表)
Query OK, 0 rows affected (0.01 sec)

mysql> LOAD DATA INFILE '/tmp/tutor.txt' INTO TABLE tutors;(将系统文件tutor.txt文件数据导入到tutors表中)
Query OK, 9 rows affected (0.01 sec)
Records: 9  Deleted: 0  Skipped: 0  Warnings: 0

mysql> \q(退出)
Bye

[root@localhost ~]# mysql(连接Mysql)
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 5.5.28-log Source distribution

Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> START TRANSACTION;(启动一个事务)
Query OK, 0 rows affected (0.00 sec)

mysql> USE jiaowu;(修改默认数据库为jiaowu)
Database changed

mysql> DESC tutors;(查看tutors表结构)
+--------+----------------------+------+-----+---------+----------------+
| Field  | Type                 | Null | Key | Default | Extra          |
+--------+----------------------+------+-----+---------+----------------+
| TID    | smallint(5) unsigned | NO   | PRI | NULL    | auto_increment |
| Tname  | varchar(50)          | NO   |     | NULL    |                |
| Gender | enum('F','M')        | YES  |     | M       |                |
| Age    | tinyint(3) unsigned  | YES  |     | NULL    |                |
+--------+----------------------+------+-----+---------+----------------+
4 rows in set (0.01 sec)

mysql> INSERT INTO tutors (Tname) VALUES ('stu001');(向tutors表中Tname字段插入数据)
Query OK, 1 row affected (0.00 sec)

[root@localhost tmp]# mysql(连接mysql)
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 12
Server version: 5.5.28-log Source distribution

Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> USE jiaowu;(修改默认数据库为jiaowu)
Database changed

mysql> SELECT @@tx_isolation;(查看tx_isolation变量值)
+-----------------+
| @@tx_isolation  |
+-----------------+
| REPEATABLE-READ |
+-----------------+
1 row in set (0.00 sec)

提示:REPEATABLE-READ可重读的;

mysql> START TRANSACTION;(启动事务)
Query OK, 0 rows affected (0.00 sec)

mysql> SELECT * FROM tutors;(查看tutors表所有字段数据)
+-----+--------------+--------+------+
| TID | Tname        | Gender | Age  |
+-----+--------------+--------+------+
|   1 | HongQigong   | M      |   93 |
|   2 | HuangYaoshi  | M      |   63 |
|   3 | Miejueshitai | F      |   72 |
|   4 | OuYangfeng   | M      |   76 |
|   5 | YiDeng       | M      |   90 |
|   6 | YuCanghai    | M      |   56 |
|   7 | Jinlunfawang | M      |   67 |
|   8 | HuYidao      | M      |   42 |
|   9 | NingZhongze  | F      |   49 |
+-----+--------------+--------+------+
9 rows in set (0.00 sec)

提示:不能看到,因为别人没有提交;

mysql> COMMIT;(提交事务)
Query OK, 0 rows affected (0.00 sec)

mysql> FLUSH TABLES WITH READ LOCK;(刷新表并以只读方式锁定表)
Query OK, 0 rows affected (0.01 sec)

mysql> INSERT INTO tutors (Tname) VALUES ('stu002');(向tutors表的Tname字段插入数据)

提示:命令卡住,无法插入,所以在执行做快照卷之前一定要FLUSH TABLES WITH READ LOCK;执行完之后最后执行一次FLUSH LOGS;

mysql> FLUSH LOGS;(手动让二进制日志文件滚动一次)
Query OK, 0 rows affected (0.01 sec)

mysql> SHOW MASTER STATUS;(查看正在使用的二进制日志文件)
+------------------+----------+--------------+------------------+
| File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+------------------+----------+--------------+------------------+
| mysql-bin.000005 |      107 |              |                  |
+------------------+----------+--------------+------------------+
1 row in set (0.00 sec)

提示:请确保二进制日志位置,把这些信息保存下来,将来在做即时点还原的时候知道我们的备份执行到了二进制日志事件那一刻,此时FLUSH TABLES WITH READ LOCK;不能退出,
可以再打开一个窗口;

[root@localhost ~]# mysql -e 'SHOW MASTER STATUS;'(不能登录mysql执行显示当前使用的二进制日志文件)
+------------------+----------+--------------+------------------+
| File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+------------------+----------+--------------+------------------+
| mysql-bin.000005 |      107 |              |                  |
+------------------+----------+--------------+------------------+

[root@localhost ~]# mysql -e 'SHOW MASTER STATUS\G'(不登录mysql执行显示当前使用二进制日志文件,\G竖状显示)
*************************** 1. row ***************************
            File: mysql-bin.000005
        Position: 107
    Binlog_Do_DB: 
Binlog_Ignore_DB: 

[root@localhost ~]# mkdir /backup/(创建目录backup)
[root@localhost ~]# mysql -e 'SHOW MASTER STATUS\G' > /backup/master`date +%F`.info(不登录mysql执行显示当前使用二进制日志文件,输出到/backup目录)
[root@localhost ~]# ls /backup/(查看当前目录文件及子目录)
master2016-02-28.info  master.info
[root@localhost ~]# lvcreate -L 50M -s -p r -n mydata-snap /dev/myvg/mydata(对/dev/myvg/mydata状态快照卷叫mydata-snap,-L快照卷大小,-s快照卷
,-n指定快照卷名称,-p指定快照卷权限)
  Rounding up size to full physical extent 52.00 MB
  Logical volume "mydata-snap" created
[root@localhost ~]# lvs(查看系统上LV逻辑卷信息)
  LV          VG   Attr   LSize  Origin Snap%  Move Log Copy%  Convert
  mydata      myvg owi-ao 10.00G                                      
  mydata-snap myvg sri-a- 52.00M mydata   0.02 
[root@localhost ~]# mount(查看当前系统上所有挂载的文件系统)
/dev/sda2 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
/dev/sr0 on /media type iso9660 (ro)
/dev/mapper/myvg-mydata on /mydata type ext3 (rw)

提示:快照卷创建好了,就可以释放mysql只读锁;

mysql> UNLOCK TABLES;(释放所有表只读锁)
Query OK, 0 rows affected (0.00 sec)

mysql> INSERT INTO tutors (Tname) VALUES ('stu002');(向tutors表Tname字段插入数据)
Query OK, 1 row affected (31 min 55.15 sec)

提示:释放锁后,这边数据插入成功;

mysql> SHOW MASTER STATUS;(查看当前使用的二进制日志文件)
+------------------+----------+--------------+------------------+
| File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+------------------+----------+--------------+------------------+
| mysql-bin.000005 |      107 |              |                  |
+------------------+----------+--------------+------------------+
1 row in set (0.00 sec)

mysql> COMMIT;(提交事务)
Query OK, 0 rows affected (0.05 sec)

mysql> SHOW MASTER STATUS;(查看当前使用的二进制日志文件)
+------------------+----------+--------------+------------------+
| File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+------------------+----------+--------------+------------------+
| mysql-bin.000005 |      478 |              |                  |
+------------------+----------+--------------+------------------+
1 row in set (0.00 sec)

提示:刚才插入的两行都已经插入进二进制日志文件中;

[root@localhost ~]# mount /dev/myvg/mydata-snap /mnt -o ro(挂在/dev/myvg/mydata-snap到/mnt,-o指定额外挂在选项,ro只读)
[root@localhost ~]# cd /mnt/(切换到/mnt目录)
[root@localhost mnt]# ls
data  lost+found
[root@localhost mnt]# cd data/(切换到data目录)
[root@localhost data]# ls(查看当前目录文件及子目录)
ibdata1      ib_logfile1  localhost.localdomain.err  mydb   mysql-bin.000001  mysql-bin.000003  mysql-bin.000005  performance_schema
ib_logfile0  jiaowu       localhost.localdomain.pid  mysql  mysql-bin.000002  mysql-bin.000004  mysql-bin.index   test
提示:如果要做全库备份,除了二进制日志文件之外所有其它数据都要备份,如果只做某个单独数据库备份,直接把mysql目录复制出去就可以了,但是要备份jiaowu数据库只复制jiao
wu库是不可以的,jiaowu库里面表所使用的存储引擎都是Innodb的,而Innodb存储引擎默认它是不会每表一个表空间的,而表空间在ibdata1;
[root@localhost data]# ls jiaowu/(查看jiaowu目录文件及子目录)
courses.frm  courses.ibd  db.opt  scores.frm  scores.ibd  students.frm  students.ibd  tutors.frm  tutors.ibd
提示:这个目录只有每个表的表结构,而数据不在这个目录里面,在ibdata1里面,这就是为什么我们尽可能使用
innodb_file_per_table,如果使用了数据也在它对应的数据库目录下,同时无论如何事务日志要备份;
[root@localhost data]# mkdir /backup/full-backup-`date +%F`(创建目录full-backup-`date +%F`)
[root@localhost data]# cp -a ./* /backup/full-backup-2016-02-28/(复制当前目录下所有文件到/backup/full-backup-2016-02-28/目录,-a保留文件原来所有
属性)
提示:这表示备份完成了;
[root@localhost data]# cd(切换到用户家目录)
[root@localhost ~]# umount /mnt/(卸载/mnt目录下的挂载设备)
[root@localhost ~]# lvremove --force /dev/myvg/mydata-snap(移除快照卷,--force强制) 
  Logical volume "mydata-snap" successfully removed
[root@localhost ~]# cd /backup/full-backup-2016-02-28/(切换到/backup/full-backup-2016-02-28/目录)
[root@localhost full-backup-2016-02-28]# ls(查看当前目录文件及子目录)
ibdata1      ib_logfile1  localhost.localdomain.err  mydb   mysql-bin.000001  mysql-bin.000003  mysql-bin.000005  performance_schema
ib_logfile0  jiaowu       localhost.localdomain.pid  mysql  mysql-bin.000002  mysql-bin.000004  mysql-bin.index   test
提示:二进制日志文件对我们没有意义;
[root@localhost full-backup-2016-02-28]# rm mysql-bin.* -f(删除mysql-bin.*所有文件,-f强制删除)
[root@localhost full-backup-2016-02-28]# ls(查看当前目录文件及子目录)
ibdata1  ib_logfile0  ib_logfile1  jiaowu  localhost.localdomain.err  localhost.localdomain.pid  mydb  mysql  performance_schema  test
提示:很显然我们拿这些文件恢复之后它是不包含刚才新加的stu001和stu002的,
[root@localhost ~]# cd /mydata/data/(切换到用户家目录)
[root@localhost data]# ls(查看当前目录文件及子目录)
ibdata1      ib_logfile1  localhost.localdomain.err  mydb   mysql-bin.000001  mysql-bin.000003  mysql-bin.000005  performance_schema
ib_logfile0  jiaowu       localhost.localdomain.pid  mysql  mysql-bin.000002  mysql-bin.000004  mysql-bin.index   test
[root@localhost data]# cat /backup/master2016-02-28.info(查看master2016-02-28.info文件内容)
*************************** 1. row ***************************
            File: mysql-bin.000005
        Position: 107
    Binlog_Do_DB: 
Binlog_Ignore_DB: 
[root@localhost data]# mysql(连接mysql数据库)
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 18
Server version: 5.5.28-log Source distribution

Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> FLUSH LOGS;(手动滚动一次二进制日志文件)
Query OK, 0 rows affected (0.01 sec)

mysql> USE jiaowu;(修改默认数据库为jiaowu)
Database changed

mysql> INSERT INTO tutors (Tname) VALUES ('stu003');(向tutors表的Tname字段插入数据)
Query OK, 1 row affected (0.14 sec)

mysql> INSERT INTO tutors (Tname) VALUES ('stu004');(向tutors表的Tname字段插入数据)
Query OK, 1 row affected (0.01 sec

mysql> SHOW MASTER STATUS;(查看当前使用的二进制日志文件)
+------------------+----------+--------------+------------------+
| File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+------------------+----------+--------------+------------------+
| mysql-bin.000006 |      575 |              |                  |
+------------------+----------+--------------+------------------+
1 row in set (0.00 sec)

mysql> \q(退出)
Bye

提示: mysql-bin.000006二进制文件也有很多数据;

[root@localhost data]# ls(查看当前目录文件及子目录)
ibdata1      ib_logfile1  localhost.localdomain.err  mydb   mysql-bin.000001  mysql-bin.000003  mysql-bin.000005  mysql-bin.index     test
ib_logfile0  jiaowu       localhost.localdomain.pid  mysql  mysql-bin.000002  mysql-bin.000004  mysql-bin.000006  performance_schema

提示:现在需要从完全备份以后所有事件都给它备份出来该怎么办,也就意味着mysql-bin.000005和mysql-bin.000006两个文件都要备份出来,想通过导出的方式备份怎么办,但我们
而言最简单的方式把这两个文件复制出去都可以了,但是复制出去将来能不能拿来直接还原,不能,得先把它读出来保存为SQL格式;
[root@localhost data]# mysqlbinlog --start-position=107 mysql-bin.000005(查看mysql-bin.000005文件内容,--start-position事件位置) 
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
# at 4
#160228  9:39:52 server id 1  end_log_pos 107 	Start: binlog v 4, server v 5.5.28-log created 160228  9:39:52
BINLOG '
6E/SVg8BAAAAZwAAAGsAAAAAAAQANS41LjI4LWxvZwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAEzgNAAgAEgAEBAQEEgAAVAAEGggAAAAICAgCAA==
'/*!*/;
# at 107
#160228 10:13:12 server id 1  end_log_pos 177 	Query	thread_id=11	exec_time=0	error_code=0
SET TIMESTAMP=1456625592/*!*/;
SET @@session.pseudo_thread_id=11/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
BEGIN
/*!*/;
# at 177
#160228  9:33:43 server id 1  end_log_pos 205 	Intvar
SET INSERT_ID=10/*!*/;
# at 205
#160228  9:33:43 server id 1  end_log_pos 314 	Query	thread_id=11	exec_time=0	error_code=0
use jiaowu/*!*/;
SET TIMESTAMP=1456623223/*!*/;
INSERT INTO tutors (Tname) VALUES ('stu001')
/*!*/;
# at 314
#160228  9:38:25 server id 1  end_log_pos 342 	Intvar
SET INSERT_ID=11/*!*/;
# at 342
#160228  9:38:25 server id 1  end_log_pos 451 	Query	thread_id=11	exec_time=1916	error_code=0
SET TIMESTAMP=1456623505/*!*/;
INSERT INTO tutors (Tname) VALUES ('stu002')
/*!*/;
# at 451
#160228 10:13:12 server id 1  end_log_pos 478 	Xid = 274
COMMIT/*!*/;
# at 478
#160228 13:27:14 server id 1  end_log_pos 521 	Rotate to mysql-bin.000006  pos: 4
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
[root@localhost data]# mysqlbinlog --start-datetime='2016-02-28  9:39:52' mysql-bin.000005 mysql-bin.000006(查看mysql-bin.000005和mysql-bin
.000006内容,--start-datetime起始时间) 
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
# at 4
#160228  9:39:52 server id 1  end_log_pos 107 	Start: binlog v 4, server v 5.5.28-log created 160228  9:39:52
BINLOG '
6E/SVg8BAAAAZwAAAGsAAAAAAAQANS41LjI4LWxvZwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAEzgNAAgAEgAEBAQEEgAAVAAEGggAAAAICAgCAA==
'/*!*/;
# at 107
#160228 10:13:12 server id 1  end_log_pos 177 	Query	thread_id=11	exec_time=0	error_code=0
SET TIMESTAMP=1456625592/*!*/;
SET @@session.pseudo_thread_id=11/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
BEGIN
/*!*/;
# at 177
#160228  9:33:43 server id 1  end_log_pos 205 	Intvar
SET INSERT_ID=10/*!*/;
# at 205
#160228  9:33:43 server id 1  end_log_pos 314 	Query	thread_id=11	exec_time=0	error_code=0
use jiaowu/*!*/;
SET TIMESTAMP=1456623223/*!*/;
INSERT INTO tutors (Tname) VALUES ('stu001')
/*!*/;
# at 314
#160228  9:38:25 server id 1  end_log_pos 342 	Intvar
SET INSERT_ID=11/*!*/;
# at 342
#160228  9:38:25 server id 1  end_log_pos 451 	Query	thread_id=11	exec_time=1916	error_code=0
SET TIMESTAMP=1456623505/*!*/;
INSERT INTO tutors (Tname) VALUES ('stu002')
/*!*/;
# at 451
#160228 10:13:12 server id 1  end_log_pos 478 	Xid = 274
COMMIT/*!*/;
# at 478
#160228 13:27:14 server id 1  end_log_pos 521 	Rotate to mysql-bin.000006  pos: 4
DELIMITER ;
DELIMITER /*!*/;
# at 4
#160228 13:27:14 server id 1  end_log_pos 107 	Start: binlog v 4, server v 5.5.28-log created 160228 13:27:14
# Warning: this binlog is either in use or was not closed properly.
BINLOG '
MoXSVg8BAAAAZwAAAGsAAAABAAQANS41LjI4LWxvZwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAEzgNAAgAEgAEBAQEEgAAVAAEGggAAAAICAgCAA==
'/*!*/;
# at 107
#160228 13:28:33 server id 1  end_log_pos 177 	Query	thread_id=18	exec_time=0	error_code=0
SET TIMESTAMP=1456637313/*!*/;
SET @@session.pseudo_thread_id=18/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
BEGIN
/*!*/;
# at 177
#160228 13:28:33 server id 1  end_log_pos 205 	Intvar
SET INSERT_ID=12/*!*/;
# at 205
#160228 13:28:33 server id 1  end_log_pos 314 	Query	thread_id=18	exec_time=0	error_code=0
use jiaowu/*!*/;
SET TIMESTAMP=1456637313/*!*/;
INSERT INTO tutors (Tname) VALUES ('stu003')
/*!*/;
# at 314
#160228 13:28:33 server id 1  end_log_pos 341 	Xid = 312
COMMIT/*!*/;
# at 341
#160228 13:29:15 server id 1  end_log_pos 411 	Query	thread_id=18	exec_time=0	error_code=0
SET TIMESTAMP=1456637355/*!*/;
BEGIN
/*!*/;
# at 411
#160228 13:29:15 server id 1  end_log_pos 439 	Intvar
SET INSERT_ID=13/*!*/;
# at 439
#160228 13:29:15 server id 1  end_log_pos 548 	Query	thread_id=18	exec_time=0	error_code=0
SET TIMESTAMP=1456637355/*!*/;
INSERT INTO tutors (Tname) VALUES ('stu004')
/*!*/;
# at 548
#160228 13:29:15 server id 1  end_log_pos 575 	Xid = 313
COMMIT/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;

提示:如果我们的事件跨文件了就要基于时间来做限定,这样就可以把他们保存一块了;

[root@localhost data]# mysqlbinlog --start-datetime='2016-02-28  9:39:52' mysql-bin.000005 mysql-bin.000006 > /backup/incremental-`date +
%F-%H-%M-%S`.sql(查看mysql-bin.000005和mysql-bin.000006内容保存到incremental文件,--start-datetime起始时间) 
[root@localhost data]# service mysqld stop(停止mysqld服务)
Shutting down MySQL...                                     [  OK  ]
[root@localhost data]# ls(查看当前目录文件及子目录)
ibdata1      ib_logfile1  localhost.localdomain.err  mysql             mysql-bin.000002  mysql-bin.000004  mysql-bin.000006  performance_
schema
ib_logfile0  jiaowu       mydb                       mysql-bin.000001  mysql-bin.000003  mysql-bin.000005  mysql-bin.index   test
[root@localhost data]# rm -rf ./*(删除当前目录下所有文件)
[root@localhost data]# ls(查看当前目录文件及子目录)
[root@localhost data]# cd(切换到用户家目录)
[root@localhost ~]# ls(查看当前目录文件及子目录)
alldatabases.sql  a.sql               install.log         mon-incremental.sql  studb-2016-02-28-01-55-28.sql  temp.sql
all.sql           cmake-2.8.8         install.log.syslog  mysql-5.5.28         studb-2016-02-28-01-58-50.sql  test.sql
anaconda-ks.cfg   cmake-2.8.8.tar.gz  jiaowu.sql          mysql-5.5.28.tar.gz  studb.sql
[root@localhost ~]# cp -a /backup/full-backup-2016-02-28/* /mydata/data/(复制/backup/full-backup-2016-02-28/目录下所有文件到/mydata/data,-a
保留文件属性)
[root@localhost ~]# ls /mydata/data/(查看/mydata/data目录文件及子目录)
ibdata1  ib_logfile0  ib_logfile1  jiaowu  localhost.localdomain.err  localhost.localdomain.pid  mydb  mysql  performance_schema  test
提示:现在数据文件都有了,就是没有二进制日志;
[root@localhost ~]# ll /mydata/data/(查看/mydata/data目录文件及子目录详细信息)
total 28788
-rw-rw---- 1 mysql mysql 18874368 Feb 28 09:33 ibdata1
-rw-rw---- 1 mysql mysql  5242880 Feb 28 09:33 ib_logfile0
-rw-rw---- 1 mysql mysql  5242880 Feb 28 05:10 ib_logfile1
drwx------ 2 mysql mysql     4096 Feb 28 09:28 jiaowu
-rw-rw---- 1 mysql root      1878 Feb 28 05:10 localhost.localdomain.err
-rw-rw---- 1 mysql mysql        6 Feb 28 05:10 localhost.localdomain.pid
drwx------ 2 mysql mysql     4096 Feb 28 05:19 mydb
drwx------ 2 mysql root      4096 Feb 28 05:10 mysql
drwx------ 2 mysql mysql     4096 Feb 28 05:10 performance_schema
drwx------ 2 mysql root      4096 Feb 28 05:10 test
提示:主要保证属主是mysql用户;
[root@localhost ~]# service mysqld start(启动mysqld服务)
Starting MySQL                                             [  OK  ]
[root@localhost ~]# ls /mydata/data/(查看/mydata/data目录文件及子目录)
ibdata1      ib_logfile1  localhost.localdomain.err  mydb   mysql-bin.000001  performance_schema
ib_logfile0  jiaowu       localhost.localdomain.pid  mysql  mysql-bin.index   test
提示:他会自动创建一个二进制日志文件,仍然从000001开始;
[root@localhost ~]# mysql(连接mysql)
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.5.28-log Source distribution

Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> USE jiaowu;(修改默认数据库为jiaowu)
Database changed

mysql> SELECT * FROM tutors;(查看tutors表所有字段数据)
+-----+--------------+--------+------+
| TID | Tname        | Gender | Age  |
+-----+--------------+--------+------+
|   1 | HongQigong   | M      |   93 |
|   2 | HuangYaoshi  | M      |   63 |
|   3 | Miejueshitai | F      |   72 |
|   4 | OuYangfeng   | M      |   76 |
|   5 | YiDeng       | M      |   90 |
|   6 | YuCanghai    | M      |   56 |
|   7 | Jinlunfawang | M      |   67 |
|   8 | HuYidao      | M      |   42 |
|   9 | NingZhongze  | F      |   49 |
+-----+--------------+--------+------+
9 rows in set (0.00 sec)

mysql> SET sql_log_bin=0;(关闭记录二进制日志)
Query OK, 0 rows affected (0.00 sec)

mysql> SOURCE /backup/incremental-2016-02-28-13-43-01.sql;(执行incremental的SQL脚步到mysql)
Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.01 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Charset changed
Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Database changed
Query OK, 0 rows affected (0.00 sec)

Query OK, 1 row affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 1 row affected (0.00 sec)

Query OK, 0 rows affected (0.01 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.01 sec)

Charset changed
Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Database changed
Query OK, 0 rows affected (0.00 sec)

Query OK, 1 row affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 1 row affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

mysql> SELECT * FROM tutors;(查看tutors表中所有字段数据)
+-----+--------------+--------+------+
| TID | Tname        | Gender | Age  |
+-----+--------------+--------+------+
|   1 | HongQigong   | M      |   93 |
|   2 | HuangYaoshi  | M      |   63 |
|   3 | Miejueshitai | F      |   72 |
|   4 | OuYangfeng   | M      |   76 |
|   5 | YiDeng       | M      |   90 |
|   6 | YuCanghai    | M      |   56 |
|   7 | Jinlunfawang | M      |   67 |
|   8 | HuYidao      | M      |   42 |
|   9 | NingZhongze  | F      |   49 |
|  10 | stu001       | M      | NULL |
|  11 | stu002       | M      | NULL |
|  12 | stu003       | M      | NULL |
|  13 | stu004       | M      | NULL |
+-----+--------------+--------+------+
13 rows in set (0.01 sec)

mysql> SET sql_log_bin=1;(开启记录二进制日志)
Query OK, 0 rows affected (0.00 sec)

mysql> SHOW MASTER STATUS;(查看当前使用的二进制日志文件)
+------------------+----------+--------------+------------------+
| File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+------------------+----------+--------------+------------------+
| mysql-bin.000001 |      107 |              |                  |
+------------------+----------+--------------+------------------+
1 row in set (0.00 sec)

二进制日志相关的几个选项


innodb_support_xa={TRUE|FLASE}(innodb是不是支持分布式事务)

存储引擎事务在存储引擎内部被赋予了ACID属性,分布式(XA)事务是一种高层次的事务,它利用“准备”然后“提交”(prepare-then-commit)两段式的方式将ACID属性扩展到存储引擎外部,甚至是数据库外部。然而,“准备”阶段会导致额外的磁盘刷写操作。XA需要事务协调员,它会通知所有的参与者准备提交事务(阶段1)。当协调员从所有参与者那里收到“就绪”信息时,它会指示所有参与者进行真正的“提交”操作。

此变量正是用于定义InnoDB是否支持两段式提交的分布式事务,默认为启用。事实上,所有启用了二进制日志的并支持多个线程同时向二进制日志写入数据的MySQL服务器都需要启用分布式事务,否则,多个线程对二进制日志的写入操作可能会以与原始次序不同的方式完成,这将会在基于二进制日志的恢复操作中或者是从服务器上创建出不同原始数据的结果。因此,除了仅有一个线程可以改变数据以外的其它应用场景都不应该禁用此功能。而在仅有一个线程可以修改数据的应用中,禁用此功能是安全的并可以提升InnoDB表的性能。作用范围为全局和会话级别,可用于选项文件,属动态变量。

sync_binlog =1 这样使得我们在备份过程当中不会有那些正在写入的事务;

设定多久同步一次二进制日志至磁盘文件中,0表示不同步,任何正数值都表示对二进制每多少次写操作之后同步一次。当autocommit的值为1时,每条语句的执行都会引起二进制日志同步,否则,每个事务的提交会引起二进制日志同步。

percona:

  ibbackup: InnoDB online physical backup(在线物理备份)

    full 完全备份

    incremental 增量备份

  MyISAM: warm backup(温备),fuul(完全备份)

  $5000

mysqldump 适合小型数据库,逻辑备份,恢复速度慢;

LVM --> mylvmbackup(perl scripts)

percona: https://www.percona.com/

  xtrabackup

    xtradb: innodb的增强板

    innodb:

xtrabackup+二进制日志;

xtrabackup支持对Innodb存储引擎做增量备份,但是MyISAM存储引擎不支持,如果涉及到的是MyISAM存储引擎做的是完全备份;

mysql:

使用Xtrabackup进行MySQL备份:

一、安装

1、简介

Xtrabackup是由percona提供的mysql数据库备份工具,据官方介绍,这也是世界上惟一一款开源的能够对innodb和xtradb数据库进行热备的工具。特点:

(1)备份过程快速、可靠;

(2)备份过程不会打断正在执行的事务;

(3)能够基于压缩等功能节约磁盘空间和流量;

(4)自动实现备份检验;

(5)还原速度快;

2、安装

其最新版的软件可从 http://www.percona.com/software/percona-xtrabackup/ 获得。本文基于RHEL5.8的系统,因此,直接下载相应版本的rpm包安装即可,这里不再演示其过程。

二、备份的实现

1、完全备份

# innobackupex --user=DBUSER --password=DBUSERPASS /path/to/BACKUP-DIR/(/path/to/BACKUP-DIR/备份文件保存什么位置)

如果要使用一个最小权限的用户进行备份,则可基于如下命令创建此类用户:

mysql> CREATE USER ’bkpuser’@’localhost’ IDENTIFIED BY ’s3cret’;

mysql> REVOKE ALL PRIVILEGES, GRANT OPTION FROM ’bkpuser’;

mysql> GRANT RELOAD, LOCK TABLES, REPLICATION CLIENT ON *.* TO ’bkpuser’@’localhost’;

mysql> FLUSH PRIVILEGES;

使用innobakupex备份时,其会调用xtrabackup备份所有的InnoDB表,复制所有关于表结构定义的相关文件(.frm)、以及MyISAM、MERGE、CSV和ARCHIVE表的相关文件,同时还会备份触发器和数据库配置信息相关的文件。这些文件会被保存至一个以时间命令的目录中。

在备份的同时,innobackupex还会在备份目录中创建如下文件:

(1)xtrabackup_checkpoints —— 备份类型(如完全或增量)、备份状态(如是否已经为prepared状态)和LSN(日志序列号)范围信息;

每个InnoDB页(通常为16k大小)都会包含一个日志序列号,即LSN。LSN是整个数据库系统的系统版本号,每个页面相关的LSN能够表明此页面最近是如何发生改变的。

(2)xtrabackup_binlog_info —— mysql服务器当前正在使用的二进制日志文件及至备份这一刻为止二进制日志事件的位置。

(3)xtrabackup_binlog_pos_innodb —— 二进制日志文件及用于InnoDB或XtraDB表的二进制日志文件的当前position。

(4)xtrabackup_binary —— 备份中用到的xtrabackup的可执行文件;

(5)backup-my.cnf —— 备份命令用到的配置选项信息;

在使用innobackupex进行备份时,还可以使用--no-timestamp选项来阻止命令自动创建一个以时间命名的目录;如此一来,innobackupex命令将会创建一个BACKUP-DIR目录来存储备份数据。

2、准备(prepare)一个完全备份

一般情况下,在备份完成后,数据尚且不能用于恢复操作,因为备份的数据中可能会包含尚未提交的事务或已经提交但尚未同步至数据文件中的事务。因此,此时数据文件仍处理不一致状态。“准备”的主要作用正是通过回滚未提交的事务及同步已经提交的事务至数据文件也使得数据文件处于一致性状态。

innobakupex命令的--apply-log选项可用于实现上述功能。如下面的命令:

# innobackupex --apply-log /path/to/BACKUP-DIR

如果执行正确,其最后输出的几行信息通常如下:

xtrabackup: starting shutdown with innodb_fast_shutdown = 1

120407 9:01:36 InnoDB: Starting shutdown...

120407 9:01:40 InnoDB: Shutdown completed; log sequence number 92036620

120407 09:01:40 innobackupex: completed OK!

在实现“准备”的过程中,innobackupex通常还可以使用--use-memory选项来指定其可以使用的内存的大小,默认通常为100M。如果有足够的内存可用,可以多划分一些内存给prepare的过程,以提高其完成速度。


3、从一个完全备份中恢复数据

innobackupex命令的--copy-back选项用于执行恢复操作,其通过复制所有数据相关的文件至mysql服务器DATADIR目录中来执行恢复过程。innobackupex通过backup-my.cnf来获取DATADIR目录的相关信息。

# innobackupex --copy-back /path/to/BACKUP-DIR

如果执行正确,其输出信息的最后几行通常如下:

innobackupex: Starting to copy InnoDB log files

innobackupex: in '/backup/2012-04-07_08-17-03'

innobackupex: back to original InnoDB log directory '/mydata/data'

innobackupex: Finished copying back files.

120407 09:36:10 innobackupex: completed OK!

请确保如上信息的最行一行出现“innobackupex: completed OK!”。

当数据恢复至DATADIR目录以后,还需要确保所有数据文件的属主和属组均为正确的用户,如mysql,否则,在启动mysqld之前还需要事先修改数据文件的属主和属组。如:

# chown -R mysql:mysql /mydata/data/


4、使用innobackupex进行增量备份

每个InnoDB的页面都会包含一个LSN信息,每当相关的数据发生改变,相关的页面的LSN就会自动增长。这正是InnoDB表可以进行增量备份的基础,即innobackupex通过备份上次完全备份之后发生改变的页面来实现。

要实现第一次增量备份,可以使用下面的命令进行:

# innobackupex --incremental /backup --incremental-basedir=BASEDIR

其中,BASEDIR指的是完全备份所在的目录,此命令执行结束后,innobackupex命令会在/backup目录中创建一个新的以时间命名的目录以存放所有的增量备份数据。另外,在执行过增量备份之后再一次进行增量备份时,其--incremental-basedir应该指向上一次的增量备份所在的目录。

需要注意的是,增量备份仅能应用于InnoDB或XtraDB表,对于MyISAM表而言,执行增量备份时其实进行的是完全备份。

“准备”(prepare)增量备份与整理完全备份有着一些不同,尤其要注意的是:

(1)需要在每个备份(包括完全和各个增量备份)上,将已经提交的事务进行“重放”。“重放”之后,所有的备份数据将合并到完全备份上。

(2)基于所有的备份将未提交的事务进行“回滚”。

于是,操作就变成了:

# innobackupex --apply-log --redo-only BASE-DIR

接着执行:

# innobackupex --apply-log --redo-only BASE-DIR --incremental-dir=INCREMENTAL-DIR-1

而后是第二个增量:

# innobackupex --apply-log --redo-only BASE-DIR --incremental-dir=INCREMENTAL-DIR-2

其中BASE-DIR指的是完全备份所在的目录,而INCREMENTAL-DIR-1指的是第一次增量备份的目录,INCREMENTAL-DIR-2指的是第二次增量备份的目录,其它依次类推,即如果有多次增量备份,每一次都要执行如上操作;

5、Xtrabackup的“流”及“备份压缩”功能

Xtrabackup对备份的数据文件支持“流”功能,即可以将备份的数据通过STDOUT传输给tar程序进行归档,而不是默认的直接保存至某备份目录中。要使用此功能,仅需要使用--stream选项即可。如:

# innobackupex --stream=tar /backup | gzip > /backup/`date +%F_%H-%M-%S`.tar.gz

甚至也可以使用类似如下命令将数据备份至其它服务器:

# innobackupex --stream=tar /backup | ssh user@www.magedu.com "cat - > /backups/`date +%F_%H-%M-%S`.tar"

此外,在执行本地备份时,还可以使用--parallel选项对多个文件进行并行复制。此选项用于指定在复制时启动的线程数目。当然,在实际进行备份时要利用此功能的便利性,也需要启用innodb_file_per_table选项或共享的表空间通过innodb_data_file_path选项存储在多个ibdata文件中。对某一数据库的多个文件的复制无法利用到此功能。其简单使用方法如下:

# innobackupex --parallel /path/to/backup

同时,innobackupex备份的数据文件也可以存储至远程主机,这可以使用--remote-host选项来实现:

# innobackupex --remote-host=root@www.magedu.com /path/IN/REMOTE/HOST/to/backup


6、导入或导出单张表

默认情况下,InnoDB表不能通过直接复制表文件的方式在mysql服务器之间进行移植,即便使用了innodb_file_per_table选项。而使用Xtrabackup工具可以实现此种功能,不过,此时需要“导出”表的mysql服务器启用了innodb_file_per_table选项(严格来说,是要“导出”的表在其创建之前,mysql服务器就启用了innodb_file_per_table选项),并且“导入”表的服务器同时启用了innodb_file_per_table和innodb_expand_import选项。

(1)“导出”表

导出表是在备份的prepare阶段进行的,因此,一旦完全备份完成,就可以在prepare过程中通过--export选项将某表导出了:

# innobackupex --apply-log --export /path/to/backup

此命令会为每个innodb表的表空间创建一个以.exp结尾的文件,这些以.exp结尾的文件则可以用于导入至其它服务器。

(2)“导入”表

要在mysql服务器上导入来自于其它服务器的某innodb表,需要先在当前服务器上创建一个跟原表表结构一致的表,而后才能实现将表导入:

mysql> CREATE TABLE mytable (...) ENGINE=InnoDB;

然后将此表的表空间删除:

mysql> ALTER TABLE mydatabase.mytable DISCARD TABLESPACE;

接下来,将来自于“导出”表的服务器的mytable表的mytable.ibd和mytable.exp文件复制到当前服务器的数据目录,然后使用如下命令将其“导入”:

mysql> ALTER TABLE mydatabase.mytable IMPORT TABLESPACE;

 


7、使用Xtrabackup对数据库进行部分备份

Xtrabackup也可以实现部分备份,即只备份某个或某些指定的数据库或某数据库中的某个或某些表。但要使用此功能,必须启用innodb_file_per_table选项,即每张表保存为一个独立的文件。同时,其也不支持--stream选项,即不支持将数据通过管道传输给其它程序进行处理。

此外,还原部分备份跟还原全部数据的备份也有所不同,即你不能通过简单地将prepared的部分备份使用--copy-back选项直接复制回数据目录,而是要通过导入表的方向来实现还原。当然,有些情况下,部分备份也可以直接通过--copy-back进行还原,但这种方式还原而来的数据多数会产生数据不一致的问题,因此,无论如何不推荐使用这种方式。

(1)创建部分备份

创建部分备份的方式有三种:正则表达式(--include), 枚举表文件(--tables-file)和列出要备份的数据库(--databases)。

(a)使用--include

使用--include时,要求为其指定要备份的表的完整名称,即形如databasename.tablename,如:

# innobackupex --include='^mageedu[.]tb1' /path/to/backup

(b)使用--tables-file

此选项的参数需要是一个文件名,此文件中每行包含一个要备份的表的完整名称;如:

# echo -e 'mageedu.tb1\nmageedu.tb2' > /tmp/tables.txt

# innobackupex --tables-file=/tmp/tables.txt /path/to/backup

(c)使用--databases

此选项接受的参数为数据名,如果要指定多个数据库,彼此间需要以空格隔开;同时,在指定某数据库时,也可以只指定其中的某张表。此外,此选项也可以接受一个文件为参数,文件中每一行为一个要备份的对象。如:

# innobackupex --databases="mageedu testdb" /path/to/backup

(2)整理(preparing)部分备份

prepare部分备份的过程类似于导出表的过程,要使用--export选项进行:

# innobackupex --apply-log --export /pat/to/partial/backup

此命令执行过程中,innobackupex会调用xtrabackup命令从数据字典中移除缺失的表,因此,会显示出许多关于“表不存在”类的警告信息。同时,也会显示出为备份文件中存在的表创建.exp文件的相关信息。

(3)还原部分备份

还原部分备份的过程跟导入表的过程相同。当然,也可以通过直接复制prepared状态的备份直接至数据目录中实现还原,不要此时要求数据目录处于一致状态。

[root@localhost ~]# lftp 172.16.0.1(连接ftp服务器)
lftp 172.16.0.1
lftp 172.16.0.1:~> cd pub/Sources/mysql-5.5(切换到pub/Sources/mysql-5.5目录)
lftp 172.16.0.1:/pub/Sources/mysql-5.5> get percona-xtrabackup-2.0.0-417.rhel5.i386.rpm(下载percoan-xtrabackup)
14388357 bytes transferred
lftp 172.16.0.1:/pub/Sources/mysql-5.5> bye(退出)
[root@localhost ~]# rpm -ivh percona-xtrabackup-2.0.0-417.rhel5.i386.rpm(安装percona-xtrabackup软件rpm包,-i安装,-v显示安装过程,-h显示进度条)
warning: percona-xtrabackup-2.0.0-417.rhel5.i386.rpm: Header V4 DSA signature: NOKEY, key ID cd2efd2a
Preparing...                ########################################### [100%]
   1:percona-xtrabackup     ########################################### [100%]
[root@localhost ~]# rpm -ql percona-xtrabackup(查看安装percona-xtrabackup生成那些文件)     
/usr/bin/innobackupex(脚本)
/usr/bin/innobackupex-1.5.1
/usr/bin/xbstream
/usr/bin/xtrabackup
/usr/bin/xtrabackup_51
/usr/bin/xtrabackup_55
/usr/share/doc/percona-xtrabackup-2.0.0
/usr/share/doc/percona-xtrabackup-2.0.0/COPYING
/usr/share/percona-xtrabackup-test
/usr/share/percona-xtrabackup-test/bootstrap.sh
/usr/share/percona-xtrabackup-test/disabled
/usr/share/percona-xtrabackup-test/disabled/ib_include.sh
/usr/share/percona-xtrabackup-test/disabled/tar_compressed.sh
/usr/share/percona-xtrabackup-test/disabled/xb_lru_dump.sh
/usr/share/percona-xtrabackup-test/experimental
/usr/share/percona-xtrabackup-test/experimental/bug408803.sh
/usr/share/percona-xtrabackup-test/experimental/xb_race_drop.sh
/usr/share/percona-xtrabackup-test/inc
/usr/share/percona-xtrabackup-test/inc/bug723097.sql
/usr/share/percona-xtrabackup-test/inc/common.sh
/usr/share/percona-xtrabackup-test/inc/ib_stream_common.sh
/usr/share/percona-xtrabackup-test/inc/incremental_sample-db
/usr/share/percona-xtrabackup-test/inc/incremental_sample-db/incremental_sample-schema.sql
/usr/share/percona-xtrabackup-test/inc/sakila-db
/usr/share/percona-xtrabackup-test/inc/sakila-db/sakila-data.sql
/usr/share/percona-xtrabackup-test/inc/sakila-db/sakila-schema.sql
/usr/share/percona-xtrabackup-test/kewpie
/usr/share/percona-xtrabackup-test/kewpie/.bzrignore
/usr/share/percona-xtrabackup-test/kewpie/docs
/usr/share/percona-xtrabackup-test/kewpie/docs/Makefile
/usr/share/percona-xtrabackup-test/kewpie/docs/_build
/usr/share/percona-xtrabackup-test/kewpie/docs/_static
/usr/share/percona-xtrabackup-test/kewpie/docs/_templates
/usr/share/percona-xtrabackup-test/kewpie/docs/conf.py
/usr/share/percona-xtrabackup-test/kewpie/docs/dbqp.rst
/usr/share/percona-xtrabackup-test/kewpie/docs/index.rst
/usr/share/percona-xtrabackup-test/kewpie/docs/kewpie.rst
/usr/share/percona-xtrabackup-test/kewpie/docs/make.bat
/usr/share/percona-xtrabackup-test/kewpie/docs/randgen.rst
/usr/share/percona-xtrabackup-test/kewpie/docs/sql-bench.rst
/usr/share/percona-xtrabackup-test/kewpie/docs/sysbench.rst
/usr/share/percona-xtrabackup-test/kewpie/docs/test-run.rst
/usr/share/percona-xtrabackup-test/kewpie/docs/writing_tests.rst
/usr/share/percona-xtrabackup-test/kewpie/kewpie.py
/usr/share/percona-xtrabackup-test/kewpie/lib
/usr/share/percona-xtrabackup-test/kewpie/lib/__init__.py
/usr/share/percona-xtrabackup-test/kewpie/lib/modes
/usr/share/percona-xtrabackup-test/kewpie/lib/modes/__init__.py
/usr/share/percona-xtrabackup-test/kewpie/lib/modes/dtr
/usr/share/percona-xtrabackup-test/kewpie/lib/modes/dtr/__init__.py
/usr/share/percona-xtrabackup-test/kewpie/lib/modes/dtr/dtr_test_execution.py
/usr/share/percona-xtrabackup-test/kewpie/lib/modes/dtr/dtr_test_management.py
/usr/share/percona-xtrabackup-test/kewpie/lib/modes/native
/usr/share/percona-xtrabackup-test/kewpie/lib/modes/native/__init__.py
/usr/share/percona-xtrabackup-test/kewpie/lib/modes/native/native_test_execution.py
/usr/share/percona-xtrabackup-test/kewpie/lib/modes/native/native_test_management.py
/usr/share/percona-xtrabackup-test/kewpie/lib/modes/sysbench
/usr/share/percona-xtrabackup-test/kewpie/lib/modes/sysbench/__init__.py
/usr/share/percona-xtrabackup-test/kewpie/lib/modes/sysbench/sysbench_test_execution.py
/usr/share/percona-xtrabackup-test/kewpie/lib/modes/sysbench/sysbench_test_management.py
/usr/share/percona-xtrabackup-test/kewpie/lib/modes/test_mode.py
/usr/share/percona-xtrabackup-test/kewpie/lib/opts
/usr/share/percona-xtrabackup-test/kewpie/lib/opts/__init__.py
/usr/share/percona-xtrabackup-test/kewpie/lib/opts/defaults.py
/usr/share/percona-xtrabackup-test/kewpie/lib/opts/matrix_manager.py
/usr/share/percona-xtrabackup-test/kewpie/lib/opts/test_run_options.py
/usr/share/percona-xtrabackup-test/kewpie/lib/server_mgmt
/usr/share/percona-xtrabackup-test/kewpie/lib/server_mgmt/__init__.py
/usr/share/percona-xtrabackup-test/kewpie/lib/server_mgmt/drizzled.py
/usr/share/percona-xtrabackup-test/kewpie/lib/server_mgmt/galera.py
/usr/share/percona-xtrabackup-test/kewpie/lib/server_mgmt/mysqld.py
/usr/share/percona-xtrabackup-test/kewpie/lib/server_mgmt/percona.py
/usr/share/percona-xtrabackup-test/kewpie/lib/server_mgmt/server.py
/usr/share/percona-xtrabackup-test/kewpie/lib/server_mgmt/server_management.py
/usr/share/percona-xtrabackup-test/kewpie/lib/sys_mgmt
/usr/share/percona-xtrabackup-test/kewpie/lib/sys_mgmt/__init__.py
/usr/share/percona-xtrabackup-test/kewpie/lib/sys_mgmt/codeTree.py
/usr/share/percona-xtrabackup-test/kewpie/lib/sys_mgmt/code_management.py
/usr/share/percona-xtrabackup-test/kewpie/lib/sys_mgmt/environment_management.py
/usr/share/percona-xtrabackup-test/kewpie/lib/sys_mgmt/logging_management.py
/usr/share/percona-xtrabackup-test/kewpie/lib/sys_mgmt/port_management.py
/usr/share/percona-xtrabackup-test/kewpie/lib/sys_mgmt/system_management.py
/usr/share/percona-xtrabackup-test/kewpie/lib/sys_mgmt/time_management.py
/usr/share/percona-xtrabackup-test/kewpie/lib/test_mgmt
/usr/share/percona-xtrabackup-test/kewpie/lib/test_mgmt/__init__.py
/usr/share/percona-xtrabackup-test/kewpie/lib/test_mgmt/execution_management.py
/usr/share/percona-xtrabackup-test/kewpie/lib/test_mgmt/test_execution.py
/usr/share/percona-xtrabackup-test/kewpie/lib/test_mgmt/test_management.py
/usr/share/percona-xtrabackup-test/kewpie/lib/util
/usr/share/percona-xtrabackup-test/kewpie/lib/util/__init__.py
/usr/share/percona-xtrabackup-test/kewpie/lib/util/crashme_methods.py
/usr/share/percona-xtrabackup-test/kewpie/lib/util/mysqlBaseTestCase.py
/usr/share/percona-xtrabackup-test/kewpie/lib/util/mysql_methods.py
/usr/share/percona-xtrabackup-test/kewpie/lib/util/randgen_methods.py
/usr/share/percona-xtrabackup-test/kewpie/lib/util/sqlbench_methods.py
/usr/share/percona-xtrabackup-test/kewpie/lib/util/xtrabackup_methods.py
/usr/share/percona-xtrabackup-test/kewpie/percona_tests
/usr/share/percona-xtrabackup-test/kewpie/percona_tests/__init__.py
/usr/share/percona-xtrabackup-test/kewpie/percona_tests/xtrabackup_disabled
/usr/share/percona-xtrabackup-test/kewpie/percona_tests/xtrabackup_disabled/bug514068_test.py
/usr/share/percona-xtrabackup-test/kewpie/percona_tests/xtrabackup_disabled/bug606981_test.py
/usr/share/percona-xtrabackup-test/kewpie/percona_tests/xtrabackup_disabled/bug722638_test.py
/usr/share/percona-xtrabackup-test/kewpie/percona_tests/xtrabackup_disabled/bug723097_test.py
/usr/share/percona-xtrabackup-test/kewpie/percona_tests/xtrabackup_disabled/bug729843_test.py
/usr/share/percona-xtrabackup-test/kewpie/percona_tests/xtrabackup_disabled/bug733663_test.py
/usr/share/percona-xtrabackup-test/kewpie/percona_tests/xtrabackup_disabled/bug759225_test.py
/usr/share/percona-xtrabackup-test/kewpie/percona_tests/xtrabackup_disabled/bug766607_test.py
/usr/share/percona-xtrabackup-test/kewpie/percona_tests/xtrabackup_disabled/bug810269_test.py
/usr/share/percona-xtrabackup-test/kewpie/percona_tests/xtrabackup_disabled/bug817132_test.py
/usr/share/percona-xtrabackup-test/kewpie/percona_tests/xtrabackup_disabled/bug884737_test.py
/usr/share/percona-xtrabackup-test/kewpie/percona_tests/xtrabackup_disabled/galeraInfo_test.py
/usr/share/percona-xtrabackup-test/kewpie/percona_tests/xtrabackup_disabled/ib_basic_test.py
/usr/share/percona-xtrabackup-test/kewpie/percona_tests/xtrabackup_disabled/ib_csm_csv_test.py
/usr/share/percona-xtrabackup-test/kewpie/percona_tests/xtrabackup_disabled/ib_databases_test_disabled.py
/usr/share/percona-xtrabackup-test/kewpie/percona_tests/xtrabackup_disabled/ib_incremental_test.py
/usr/share/percona-xtrabackup-test/kewpie/percona_tests/xtrabackup_disabled/ib_nonempty_dir_test.py
/usr/share/percona-xtrabackup-test/kewpie/percona_tests/xtrabackup_disabled/ib_parallel_test.py
/usr/share/percona-xtrabackup-test/kewpie/percona_tests/xtrabackup_disabled/ib_rsync_test.py
/usr/share/percona-xtrabackup-test/kewpie/percona_tests/xtrabackup_disabled/ib_slave_info_test.py
/usr/share/percona-xtrabackup-test/kewpie/percona_tests/xtrabackup_disabled/ib_slave_test.py
/usr/share/percona-xtrabackup-test/kewpie/percona_tests/xtrabackup_disabled/ib_specialchar_test.py
/usr/share/percona-xtrabackup-test/kewpie/percona_tests/xtrabackup_disabled/ib_stream_test.py
/usr/share/percona-xtrabackup-test/kewpie/percona_tests/xtrabackup_disabled/tar4ibd_symlink_test.py
/usr/share/percona-xtrabackup-test/kewpie/percona_tests/xtrabackup_disabled/xb_defaults_file_test.py
/usr/share/percona-xtrabackup-test/kewpie/percona_tests/xtrabackup_disabled/xb_export_test.py
/usr/share/percona-xtrabackup-test/kewpie/percona_tests/xtrabackup_disabled/xb_incremental_compressed_test.py
/usr/share/percona-xtrabackup-test/kewpie/percona_tests/xtrabackup_disabled/xb_incremental_test.py
/usr/share/percona-xtrabackup-test/kewpie/percona_tests/xtrabackup_disabled/xb_log_overwrap_test.py
/usr/share/percona-xtrabackup-test/kewpie/percona_tests/xtrabackup_disabled/xb_part_range_test.py
/usr/share/percona-xtrabackup-test/kewpie/percona_tests/xtrabackup_disabled/xb_partial_test.py
/usr/share/percona-xtrabackup-test/kewpie/percona_tests/xtrabackup_disabled/xb_stats_sakila_test.py
/usr/share/percona-xtrabackup-test/kewpie/percona_tests/xtrabackup_disabled/xb_stats_test.py
/usr/share/percona-xtrabackup-test/kewpie/percona_tests/xtrabackup_main
/usr/share/percona-xtrabackup-test/kewpie/percona_tests/xtrabackup_main/ib_slave_test.py
/usr/share/percona-xtrabackup-test/kewpie/qp_data
/usr/share/percona-xtrabackup-test/kewpie/randgen
/usr/share/percona-xtrabackup-test/kewpie/randgen/Contributors
/usr/share/percona-xtrabackup-test/kewpie/randgen/LICENSE
/usr/share/percona-xtrabackup-test/kewpie/randgen/Makefile
/usr/share/percona-xtrabackup-test/kewpie/randgen/README
/usr/share/percona-xtrabackup-test/kewpie/randgen/backtrace-all.gdb
/usr/share/percona-xtrabackup-test/kewpie/randgen/backtrace.gdb
/usr/share/percona-xtrabackup-test/kewpie/randgen/bench
/usr/share/percona-xtrabackup-test/kewpie/randgen/bench/WL5004_sql.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/bench/benchmark.pl
/usr/share/percona-xtrabackup-test/kewpie/randgen/bench/falcon_data_types.zz
/usr/share/percona-xtrabackup-test/kewpie/randgen/bughunt_template.cfg
/usr/share/percona-xtrabackup-test/kewpie/randgen/combinations.pl
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/backup
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/backup/backup_interop.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/backup/backup_obj.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/backup/backup_simple.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/backup/invariant.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/backup/invariant.zz
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/dbt3
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/dbt3/LICENSE
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/dbt3/dbt3-dml.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/dbt3/dbt3-joins.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/dbt3/dbt3-ranges.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/dbt3/dbt3-s0.0001.dump
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/dbt3/dbt3-s0.001.dump
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/dbt3/dbt3-s0.01.dump.bz2
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/drizzle
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/drizzle/bug680669.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/drizzle/collations_drizzle.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/drizzle/combinations_drizzle.zz
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/drizzle/data_dict_concurrent_drizzle.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/drizzle/drizzle.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/drizzle/drizzle.zz
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/drizzle/drizzledump.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/drizzle/drizzledump_migrate.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/drizzle/drizzledump_migrate.zz
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/drizzle/limit_compare_drizzle.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/drizzle/many_indexes_drizzle.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/drizzle/many_indexes_drizzle.zz
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/drizzle/optimizer_subquery_data_dictionary_drizzle.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/drizzle/optimizer_subquery_drizzle.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/drizzle/outer_join_data_dictionary_drizzle.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/drizzle/outer_join_drizzle.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/drizzle/outer_join_drizzle.zz
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/drizzle/outer_join_portable_drizzle.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/drizzle/proclist_drizzle.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/drizzle/proclist_subquery_drizzle.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/drizzle/range_access_drizzle.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/drizzle/range_access_drizzle.zz
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/drizzle/subquery_drizzle.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/drizzle/subquery_materialization_drizzle.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/drizzle/subquery_semijoin_drizzle.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/drizzle/subquery_semijoin_nested_drizzle.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/drizzle/translog_concurrent1.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/drizzle/translog_concurrent2.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/drizzle/translog_concurrent3.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/drizzle/translog_drizzle.zz
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/drizzle/translog_ordering.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/drizzle/translog_ordering.zz
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/drizzle/varchar_drizzle.zz
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/dyncol
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/dyncol/dyncol_dml.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/dyncol/dyncol_dml.zz
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/engines
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/engines/blobs.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/engines/concurrent.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/engines/engine_stress.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/engines/engine_stress.zz
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/engines/falcon
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/engines/falcon/falcon_backlog.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/engines/falcon/falcon_backlog.zz
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/engines/falcon/falcon_blobs.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/engines/falcon/falcon_blobs.zz
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/engines/falcon/falcon_chill_thaw.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/engines/falcon/falcon_chill_thaw.zz
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/engines/falcon/falcon_data_types.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/engines/falcon/falcon_data_types.zz
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/engines/falcon/falcon_data_types_no_year_time.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/engines/falcon/falcon_data_types_no_year_time.zz
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/engines/falcon/falcon_ddl.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/engines/falcon/falcon_limit.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/engines/falcon/falcon_nolimit.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/engines/falcon/falcon_nolimit_int.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/engines/falcon/falcon_online_alter.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/engines/falcon/falcon_pagesize.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/engines/falcon/falcon_pagesize2K.zz
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/engines/falcon/falcon_pagesize32K.zz
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/engines/falcon/falcon_recovery.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/engines/falcon/falcon_recovery.zz
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/engines/falcon/falcon_replication.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/engines/falcon/falcon_replication.zz
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/engines/falcon/falcon_select_autocommit.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/engines/falcon/falcon_simple.cc
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/engines/falcon/falcon_varchar.cc
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/engines/falcon/limit_compare.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/engines/handler.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/engines/handler.zz
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/engines/heap
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/engines/heap/heap.cc
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/engines/heap/heap_ddl_multi.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/engines/heap/heap_dml_single.init
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/engines/heap/heap_dml_single.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/engines/innodb
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/engines/innodb/innodb_simple.cc
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/engines/many_indexes.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/engines/many_indexes.zz
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/engines/maria
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/engines/maria/maria.zz
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/engines/maria/maria_bulk_insert.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/engines/maria/maria_dml_alter.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/engines/maria/maria_mostly_selects.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/engines/maria/maria_recovery.cc
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/engines/maria/maria_stress.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/engines/tiny_inserts.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/engines/tiny_inserts.zz
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/engines/varchar.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/engines/varchar.zz
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/examples
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/examples/example.ff
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/examples/example.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/examples/example.zz
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/examples/flightstats.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/gis
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/gis/README
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/gis/gis.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/gis/linestring.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/gis/wkt2sql.pl
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/hivol
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/hivol/hivol_fbase_small.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/hivol/hivol_film.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/i18n
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/i18n/collations.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/optimizer
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/optimizer/archive
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/optimizer/archive/subquery_materialization.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/optimizer/archive/subquery_semijoin.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/optimizer/archive/subquery_semijoin_nested.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/optimizer/blobs.zz
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/optimizer/dsmrr-cpk-compare.cc
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/optimizer/dsmrr-cpk-single.cc
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/optimizer/dsmrr-cpk.ff
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/optimizer/intersect.ff
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/optimizer/join_buffer.ff
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/optimizer/mrr-single.cc
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/optimizer/mrr.ff
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/optimizer/optimizer_access_exp.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/optimizer/optimizer_no_subquery.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/optimizer/optimizer_no_subquery_portable.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/optimizer/optimizer_subquery.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/optimizer/optimizer_subquery_no_outer_join.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/optimizer/optimizer_subquery_portable.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/optimizer/optimizer_subquery_semijoin.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/optimizer/outer_join.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/optimizer/outer_join.zz
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/optimizer/outer_join_portable.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/optimizer/range_access.ff
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/optimizer/range_access.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/optimizer/range_access.zz
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/optimizer/range_access2.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/optimizer/range_access2.zz
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/optimizer/semijoin.ff
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/optimizer/sort_union-index_merge.ff
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/optimizer/updateable_views.init
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/optimizer/updateable_views.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/optimizer/virtual_columns.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/optimizer/world.sql
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/oqgraph
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/oqgraph/oqgraph.init
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/oqgraph/oqgraph.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/oqgraph/oqgraph_bulgaria.sql.bz2
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/oqgraph/osm2oqg.pl
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/osm
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/osm/LICENCE
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/osm/andorra.sql
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/osm/osm-schema.sql
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/partitioning
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/partitioning/partition_pruning.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/partitioning/partition_pruning.zz
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/partitioning/partitions-ddl.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/partitioning/partitions-wl4571.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/partitioning/partitions.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/partitioning/partitions_procedures_triggers.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/partitioning/partitions_redefine.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/percona
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/percona/bug826632.zz
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/percona/bug892274.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/percona/innodb_dict_size_limit.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/percona/innodb_dict_size_limit.zz
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/percona/many_indexes_percona.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/percona/many_indexes_percona.zz
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/percona/mv.py
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/percona/optimizer_subquery_percona.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/percona/outer_join_percona.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/percona/outer_join_percona.zz
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/percona/percona.zz
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/percona/percona_no_blob.zz
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/percona/query_cache_strip_comments.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/percona/query_cache_strip_comments.zz
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/percona/translog_concurrent1.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/percona/translog_concurrent2.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/percona/translog_concurrent3.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/percona/translog_percona.zz
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/percona/trx_crash_commit_after.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/percona/trx_crash_commit_after_log.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/percona/trx_crash_commit_after_prepare.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/percona/trx_crash_commit_before.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/percona/trx_crash_commit_before_unlog.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/percona/trx_half_binlogged_transaction.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/percona/trx_randDebugCrash.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/replication
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/replication/WL5092_data.zz
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/replication/WL5092_sql_1.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/replication/WL5092_sql_2.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/replication/add_flushes.rr
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/replication/binlog_group_commit.cc
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/replication/insert_errors.rr
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/replication/replication-5.1.zz
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/replication/replication-6.0.zz
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/replication/replication-ddl_data.zz
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/replication/replication-ddl_sql.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/replication/replication-dml_data.zz
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/replication/replication-dml_sql.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/replication/replication.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/replication/replication_innodb_myisam.zz
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/replication/replication_simple.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/replication/replication_single_engine.zz
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/replication/replication_single_engine_pk.zz
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/replication/rpl_transactions.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/replication/rpl_transactions.zz
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/replication/rpl_transactions_nopk.zz
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/runtime
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/runtime/WL5004_data.zz
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/runtime/WL5004_sql.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/runtime/WL5004_sql_custom.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/runtime/connect_kill_data.zz
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/runtime/connect_kill_sql.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/runtime/create_drop.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/runtime/information_schema.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/runtime/metadata_locking.cc
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/runtime/metadata_stability.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/runtime/metadata_stability.zz
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/runtime/performance_schema.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/runtime/signal_resignal.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/smf
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/smf/LICENSE
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/smf/parse.pl
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/smf/smf2.sql
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/smf/smf2.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/temporal
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/temporal/temporal_functions.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/temporal/temporal_functions.zz
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/temporal/temporal_ranges.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/temporal/temporal_ranges.zz
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/temporal/temporal_replication.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/transactions
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/transactions/combinations.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/transactions/combinations.zz
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/transactions/repeatable_read.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/transactions/transaction_durability.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/transactions/transactions-flat.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/transactions/transactions.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/conf/transactions/transactions.zz
/usr/share/percona-xtrabackup-test/kewpie/randgen/data
/usr/share/percona-xtrabackup-test/kewpie/randgen/data/earth11k.jpg
/usr/share/percona-xtrabackup-test/kewpie/randgen/data/earth15kb.jpg
/usr/share/percona-xtrabackup-test/kewpie/randgen/data/earth1886kb.jpg
/usr/share/percona-xtrabackup-test/kewpie/randgen/data/earth215kb.jpg
/usr/share/percona-xtrabackup-test/kewpie/randgen/data/earth2kb.jpg
/usr/share/percona-xtrabackup-test/kewpie/randgen/data/earth579kb.jpg
/usr/share/percona-xtrabackup-test/kewpie/randgen/data/earth5kb.jpg
/usr/share/percona-xtrabackup-test/kewpie/randgen/data/earth81kb.jpg
/usr/share/percona-xtrabackup-test/kewpie/randgen/dict
/usr/share/percona-xtrabackup-test/kewpie/randgen/dict/english.txt
/usr/share/percona-xtrabackup-test/kewpie/randgen/dict/states.txt
/usr/share/percona-xtrabackup-test/kewpie/randgen/error.log
/usr/share/percona-xtrabackup-test/kewpie/randgen/gendata-old.pl
/usr/share/percona-xtrabackup-test/kewpie/randgen/gendata.pl
/usr/share/percona-xtrabackup-test/kewpie/randgen/gengrammar.pl
/usr/share/percona-xtrabackup-test/kewpie/randgen/gensql.pl
/usr/share/percona-xtrabackup-test/kewpie/randgen/gentest.pl
/usr/share/percona-xtrabackup-test/kewpie/randgen/init
/usr/share/percona-xtrabackup-test/kewpie/randgen/init/all_off.sql
/usr/share/percona-xtrabackup-test/kewpie/randgen/init/mrr_no_opt.sql
/usr/share/percona-xtrabackup-test/kewpie/randgen/init/mrr_opt.sql
/usr/share/percona-xtrabackup-test/kewpie/randgen/init/no_materialization.sql
/usr/share/percona-xtrabackup-test/kewpie/randgen/init/no_mrr.opt
/usr/share/percona-xtrabackup-test/kewpie/randgen/init/no_mrr_no_opt.sql
/usr/share/percona-xtrabackup-test/kewpie/randgen/init/no_mrr_opt.sql
/usr/share/percona-xtrabackup-test/kewpie/randgen/init/no_semijoin.sql
/usr/share/percona-xtrabackup-test/kewpie/randgen/init/no_subquery.sql
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/DBServer
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/DBServer/DBServer.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/DBServer/MySQL
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/DBServer/MySQL/MySQLd.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/DBServer/MySQL/ReplMySQLd.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/App
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/App/GenTest.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/App/Gendata.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/App/GendataSimple.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/BzrInfo.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Comparator.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Constants.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/ErrorFilter.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Executor
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Executor.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Executor/Drizzle.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Executor/Dummy.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Executor/JavaDB.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Executor/MySQL.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Executor/MySQLPrepared.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Executor/Postgres.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Explain.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Filter
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Filter/Regexp.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Generator
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Generator.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Generator/FromCSV.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Generator/FromDirectory.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Generator/FromGrammar.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Grammar
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Grammar.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Grammar/Rule.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/IPC
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/IPC/Channel.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/IPC/Process.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Incident.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Mixer
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Mixer.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Properties.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/QueryPerformance.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/QueryPerformanceDelta.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Random.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Reporter
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Reporter.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Reporter/AriaDoubleRecovery.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Reporter/Backtrace.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Reporter/BackupAndRestore.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Reporter/BackupAndRestoreInvariant.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Reporter/BackupInterop.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Reporter/BinlogCommitStats.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Reporter/CloneSlave.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Reporter/CloneSlaveXtrabackup.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Reporter/DatabaseConsistency.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Reporter/Deadlock.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Reporter/DrizzleInnoTrxLog.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Reporter/DrizzleInnoTrxLogCrashRecovery.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Reporter/DrizzleRecovery.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Reporter/DrizzleRecoveryConsistency.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Reporter/DrizzleSlavePlugin.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Reporter/DrizzleSlavePluginCrashRecover.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Reporter/DrizzleTransactionLog.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Reporter/ErrorLog.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Reporter/ErrorLogAlarm.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Reporter/LockTableKiller.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Reporter/MemoryUsage.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Reporter/MySQLClient.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Reporter/QueryTimeout.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Reporter/Recovery.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Reporter/RecoveryConsistency.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Reporter/ReplicationAnalyzeTable.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Reporter/ReplicationConnectionKiller.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Reporter/ReplicationConsistency.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Reporter/ReplicationLogFlusher.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Reporter/ReplicationSemiSync.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Reporter/ReplicationThreadRestarter.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Reporter/Shutdown.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Reporter/ValgrindErrors.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Reporter/ValgrindXMLErrors.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Reporter/WinPackage.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/ReporterManager.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Result.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Server
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/SimPipe
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/SimPipe/DBObject.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/SimPipe/Oracle
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/SimPipe/Oracle.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/SimPipe/Oracle/Crash.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/SimPipe/Oracle/FullScan.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/SimPipe/Oracle/TwiceSporadic.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/SimPipe/Testcase.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Simplifier
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Simplifier/Grammar.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Simplifier/Mysqltest.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Simplifier/SQL.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Simplifier/Tables.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Simplifier/Test.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Stack
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Stack/Stack.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Stack/StackFrame.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Statement.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Transform
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Transform.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Transform/ChangePartialMatch.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Transform/ConvertLiteralsToDyncols.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Transform/ConvertLiteralsToSubqueries.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Transform/ConvertLiteralsToVariables.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Transform/ConvertSubqueriesToViews.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Transform/ConvertTablesToDerived.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Transform/ConvertTablesToViews.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Transform/Count.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Transform/DisableChosenPlan.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Transform/DisableIndexes.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Transform/DisableJoinCache.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Transform/Distinct.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Transform/DrizzleExecuteString.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Transform/DrizzleExecuteVariable.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Transform/Dummy.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Transform/ExecuteAsDerived.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Transform/ExecuteAsFunctionTwice.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Transform/ExecuteAsInsertSelect.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Transform/ExecuteAsPreparedOnce.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Transform/ExecuteAsPreparedTwice.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Transform/ExecuteAsSPTwice.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Transform/ExecuteAsSelectItem.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Transform/ExecuteAsTrigger.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Transform/ExecuteAsUnion.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Transform/ExecuteAsUpdateDelete.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Transform/ExecuteAsView.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Transform/ExecuteAsWhereSubquery.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Transform/FromSubquery.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Transform/Having.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Transform/InlineSubqueries.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Transform/InlineVirtualColumns.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Transform/LimitDecrease.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Transform/LimitIncrease.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Transform/OrderBy.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Transform/RemoveIndexHints.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Transform/SelectOption.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Transform/StraightJoin.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Translator
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Translator.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Translator/MysqlDML2ANSI.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Translator/MysqlDML2javadb.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Translator/MysqlDML2pgsql.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Translator/Mysqldump2ANSI.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Translator/Mysqldump2javadb.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Translator/Mysqldump2pgsql.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Validator
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Validator.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Validator/AbortOnSyntaxError.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Validator/DML.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Validator/DatabaseComparator.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Validator/DatabaseConsistency.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Validator/DrizzleErrorLogScan.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Validator/DrizzleTransformer.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Validator/Drizzledump.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Validator/DrizzledumpMigrate.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Validator/ErrorMessageCorruption.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Validator/ExecutionTimeComparator.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Validator/ExplainMatch.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Validator/ExplicitRollback.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Validator/Falcon.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Validator/FalconErrors.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Validator/Invariant.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Validator/Limit.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Validator/MarkErrorLog.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Validator/OptimizerTraceParser.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Validator/OrderBy.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Validator/Performance.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Validator/QueryProperties.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Validator/RepeatableRead.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Validator/ReplicationSlaveStatus.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Validator/ReplicationWaitForSlave.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Validator/ResultsetComparator.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Validator/ResultsetComparator3.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Validator/ResultsetComparator3Simplify.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Validator/ResultsetComparatorGIS.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Validator/ResultsetComparatorSimplify.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Validator/ResultsetCorruption.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Validator/SelectStability.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Validator/Transformer.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/Validator/Transformer2.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/XML
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/XML/BuildInfo.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/XML/Environment.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/XML/Report.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/XML/Test.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/lib/GenTest/XML/Transporter.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/pb2combinations.pl
/usr/share/percona-xtrabackup-test/kewpie/randgen/pb2gentest-new.pl
/usr/share/percona-xtrabackup-test/kewpie/randgen/pb2gentest.pl
/usr/share/percona-xtrabackup-test/kewpie/randgen/pb2runtest.pl
/usr/share/percona-xtrabackup-test/kewpie/randgen/performance
/usr/share/percona-xtrabackup-test/kewpie/randgen/performance/perfreport.pl
/usr/share/percona-xtrabackup-test/kewpie/randgen/performance/perfrun.pl
/usr/share/percona-xtrabackup-test/kewpie/randgen/runall-new.pl
/usr/share/percona-xtrabackup-test/kewpie/randgen/runall.pl
/usr/share/percona-xtrabackup-test/kewpie/randgen/server.pl
/usr/share/percona-xtrabackup-test/kewpie/randgen/simpipe-crash.pl
/usr/share/percona-xtrabackup-test/kewpie/randgen/simpipe-fullscan.pl
/usr/share/percona-xtrabackup-test/kewpie/randgen/simpipe.pl
/usr/share/percona-xtrabackup-test/kewpie/randgen/simplify-grammar_template.cfg
/usr/share/percona-xtrabackup-test/kewpie/randgen/simplify-mysqltest_template-huge.cfg
/usr/share/percona-xtrabackup-test/kewpie/randgen/simplify-mysqltest_template.cfg
/usr/share/percona-xtrabackup-test/kewpie/randgen/t
/usr/share/percona-xtrabackup-test/kewpie/randgen/t/constant.t
/usr/share/percona-xtrabackup-test/kewpie/randgen/t/gensql.t
/usr/share/percona-xtrabackup-test/kewpie/randgen/t/gensql.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/t/gentest.t
/usr/share/percona-xtrabackup-test/kewpie/randgen/t/grammar-doubledefine.t.disabled
/usr/share/percona-xtrabackup-test/kewpie/randgen/t/grammar-doubledefine.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/t/grammar.t
/usr/share/percona-xtrabackup-test/kewpie/randgen/t/prng.t
/usr/share/percona-xtrabackup-test/kewpie/randgen/t/simplify-empty.t
/usr/share/percona-xtrabackup-test/kewpie/randgen/t/simplify-empty.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/t/simplify-grammar.t
/usr/share/percona-xtrabackup-test/kewpie/randgen/t/simplify-grammar.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/t/test.bat
/usr/share/percona-xtrabackup-test/kewpie/randgen/tmp
/usr/share/percona-xtrabackup-test/kewpie/randgen/translateMysql.pl
/usr/share/percona-xtrabackup-test/kewpie/randgen/unit
/usr/share/percona-xtrabackup-test/kewpie/randgen/unit/DBDVersion.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/unit/ExecutorTest.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/unit/FromGrammarTest.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/unit/GendataTest.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/unit/GendataTest.zz
/usr/share/percona-xtrabackup-test/kewpie/randgen/unit/GrammarTest.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/unit/IPC.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/unit/IPC_P1.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/unit/Metadata.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/unit/ParseAllGrammars.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/unit/README
/usr/share/percona-xtrabackup-test/kewpie/randgen/unit/RQGRunner.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/unit/RandomTest.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/unit/Suite.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/unit/TestMySQLServer.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/unit/TestReplServer.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/unit/TestScripts.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/unit/TestSqltrace.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/unit/TestTT.pm
/usr/share/percona-xtrabackup-test/kewpie/randgen/unit/exit_status.cc
/usr/share/percona-xtrabackup-test/kewpie/randgen/unit/test.cc
/usr/share/percona-xtrabackup-test/kewpie/randgen/unit/testGrammar.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/unit/testSqltrace.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/unit/testStack.yy
/usr/share/percona-xtrabackup-test/kewpie/randgen/unit/unit.pl
/usr/share/percona-xtrabackup-test/kewpie/randgen/util
/usr/share/percona-xtrabackup-test/kewpie/randgen/util/bughunt.pl
/usr/share/percona-xtrabackup-test/kewpie/randgen/util/dump-test.pl
/usr/share/percona-xtrabackup-test/kewpie/randgen/util/mask-grammar.pl
/usr/share/percona-xtrabackup-test/kewpie/randgen/util/simplify-crash.pl
/usr/share/percona-xtrabackup-test/kewpie/randgen/util/simplify-grammar.pl
/usr/share/percona-xtrabackup-test/kewpie/randgen/util/simplify-mysqltest.pl
/usr/share/percona-xtrabackup-test/kewpie/randgen/util/simplify-query-performance.pl
/usr/share/percona-xtrabackup-test/kewpie/randgen/util/simplify-query.pl
/usr/share/percona-xtrabackup-test/kewpie/randgen/util/simplify-sporadic.pl
/usr/share/percona-xtrabackup-test/python
/usr/share/percona-xtrabackup-test/python/BytesIO.py
/usr/share/percona-xtrabackup-test/python/iso8601
/usr/share/percona-xtrabackup-test/python/iso8601/LICENSE
/usr/share/percona-xtrabackup-test/python/iso8601/README
/usr/share/percona-xtrabackup-test/python/iso8601/README.subunit
/usr/share/percona-xtrabackup-test/python/iso8601/setup.py
/usr/share/percona-xtrabackup-test/python/iso8601/test_iso8601.py
/usr/share/percona-xtrabackup-test/python/junitxml
/usr/share/percona-xtrabackup-test/python/junitxml/__init__.py
/usr/share/percona-xtrabackup-test/python/junitxml/tests
/usr/share/percona-xtrabackup-test/python/junitxml/tests/__init__.py
/usr/share/percona-xtrabackup-test/python/junitxml/tests/test_junitxml.py
/usr/share/percona-xtrabackup-test/python/subunit
/usr/share/percona-xtrabackup-test/python/subunit/__init__.py
/usr/share/percona-xtrabackup-test/python/subunit/chunked.py
/usr/share/percona-xtrabackup-test/python/subunit/details.py
/usr/share/percona-xtrabackup-test/python/subunit/iso8601.py
/usr/share/percona-xtrabackup-test/python/subunit/progress_model.py
/usr/share/percona-xtrabackup-test/python/subunit/run.py
/usr/share/percona-xtrabackup-test/python/subunit/test_results.py
/usr/share/percona-xtrabackup-test/python/subunit/tests
/usr/share/percona-xtrabackup-test/python/subunit/tests/TestUtil.py
/usr/share/percona-xtrabackup-test/python/subunit/tests/__init__.py
/usr/share/percona-xtrabackup-test/python/subunit/tests/sample-script.py
/usr/share/percona-xtrabackup-test/python/subunit/tests/sample-two-script.py
/usr/share/percona-xtrabackup-test/python/subunit/tests/test_chunked.py
/usr/share/percona-xtrabackup-test/python/subunit/tests/test_details.py
/usr/share/percona-xtrabackup-test/python/subunit/tests/test_progress_model.py
/usr/share/percona-xtrabackup-test/python/subunit/tests/test_subunit_filter.py
/usr/share/percona-xtrabackup-test/python/subunit/tests/test_subunit_stats.py
/usr/share/percona-xtrabackup-test/python/subunit/tests/test_subunit_tags.py
/usr/share/percona-xtrabackup-test/python/subunit/tests/test_tap2subunit.py
/usr/share/percona-xtrabackup-test/python/subunit/tests/test_test_protocol.py
/usr/share/percona-xtrabackup-test/python/subunit/tests/test_test_results.py
/usr/share/percona-xtrabackup-test/python/testtools
/usr/share/percona-xtrabackup-test/python/testtools/__init__.py
/usr/share/percona-xtrabackup-test/python/testtools/_spinner.py
/usr/share/percona-xtrabackup-test/python/testtools/compat.py
/usr/share/percona-xtrabackup-test/python/testtools/content.py
/usr/share/percona-xtrabackup-test/python/testtools/content_type.py
/usr/share/percona-xtrabackup-test/python/testtools/deferredruntest.py
/usr/share/percona-xtrabackup-test/python/testtools/distutilscmd.py
/usr/share/percona-xtrabackup-test/python/testtools/helpers.py
/usr/share/percona-xtrabackup-test/python/testtools/matchers.py
/usr/share/percona-xtrabackup-test/python/testtools/monkey.py
/usr/share/percona-xtrabackup-test/python/testtools/run.py
/usr/share/percona-xtrabackup-test/python/testtools/runtest.py
/usr/share/percona-xtrabackup-test/python/testtools/testcase.py
/usr/share/percona-xtrabackup-test/python/testtools/testresult
/usr/share/percona-xtrabackup-test/python/testtools/testresult/__init__.py
/usr/share/percona-xtrabackup-test/python/testtools/testresult/doubles.py
/usr/share/percona-xtrabackup-test/python/testtools/testresult/real.py
/usr/share/percona-xtrabackup-test/python/testtools/tests
/usr/share/percona-xtrabackup-test/python/testtools/tests/__init__.py
/usr/share/percona-xtrabackup-test/python/testtools/tests/helpers.py
/usr/share/percona-xtrabackup-test/python/testtools/tests/test_compat.py
/usr/share/percona-xtrabackup-test/python/testtools/tests/test_content.py
/usr/share/percona-xtrabackup-test/python/testtools/tests/test_content_type.py
/usr/share/percona-xtrabackup-test/python/testtools/tests/test_deferredruntest.py
/usr/share/percona-xtrabackup-test/python/testtools/tests/test_distutilscmd.py
/usr/share/percona-xtrabackup-test/python/testtools/tests/test_fixturesupport.py
/usr/share/percona-xtrabackup-test/python/testtools/tests/test_helpers.py
/usr/share/percona-xtrabackup-test/python/testtools/tests/test_matchers.py
/usr/share/percona-xtrabackup-test/python/testtools/tests/test_monkey.py
/usr/share/percona-xtrabackup-test/python/testtools/tests/test_run.py
/usr/share/percona-xtrabackup-test/python/testtools/tests/test_runtest.py
/usr/share/percona-xtrabackup-test/python/testtools/tests/test_spinner.py
/usr/share/percona-xtrabackup-test/python/testtools/tests/test_testresult.py
/usr/share/percona-xtrabackup-test/python/testtools/tests/test_testsuite.py
/usr/share/percona-xtrabackup-test/python/testtools/tests/test_testtools.py
/usr/share/percona-xtrabackup-test/python/testtools/tests/test_with_with.py
/usr/share/percona-xtrabackup-test/python/testtools/testsuite.py
/usr/share/percona-xtrabackup-test/python/testtools/utils.py
/usr/share/percona-xtrabackup-test/run.sh
/usr/share/percona-xtrabackup-test/subunit.sh
/usr/share/percona-xtrabackup-test/subunit2junitxml
/usr/share/percona-xtrabackup-test/t
/usr/share/percona-xtrabackup-test/t/bug489290.sh
/usr/share/percona-xtrabackup-test/t/bug514068.sh
/usr/share/percona-xtrabackup-test/t/bug606981.sh
/usr/share/percona-xtrabackup-test/t/bug722638.sh
/usr/share/percona-xtrabackup-test/t/bug723097.sh
/usr/share/percona-xtrabackup-test/t/bug723318.sh
/usr/share/percona-xtrabackup-test/t/bug729843.sh
/usr/share/percona-xtrabackup-test/t/bug733651.sh
/usr/share/percona-xtrabackup-test/t/bug759225.sh
/usr/share/percona-xtrabackup-test/t/bug759701.sh
/usr/share/percona-xtrabackup-test/t/bug766033.sh
/usr/share/percona-xtrabackup-test/t/bug766607.sh
/usr/share/percona-xtrabackup-test/t/bug810269.sh
/usr/share/percona-xtrabackup-test/t/bug817132.sh
/usr/share/percona-xtrabackup-test/t/bug884737.sh
/usr/share/percona-xtrabackup-test/t/bug891496.sh
/usr/share/percona-xtrabackup-test/t/ib_binlog_info.sh
/usr/share/percona-xtrabackup-test/t/ib_csm_csv.sh
/usr/share/percona-xtrabackup-test/t/ib_empty_dir.sh
/usr/share/percona-xtrabackup-test/t/ib_incremental.sh
/usr/share/percona-xtrabackup-test/t/ib_lru_dump_basic.sh
/usr/share/percona-xtrabackup-test/t/ib_lru_dump_rsync.sh
/usr/share/percona-xtrabackup-test/t/ib_lru_dump_stream.sh
/usr/share/percona-xtrabackup-test/t/ib_rsync.sh
/usr/share/percona-xtrabackup-test/t/ib_slave_info.sh
/usr/share/percona-xtrabackup-test/t/ib_specialchar.sh
/usr/share/percona-xtrabackup-test/t/ib_stream_compress.sh
/usr/share/percona-xtrabackup-test/t/ib_stream_incremental.sh
/usr/share/percona-xtrabackup-test/t/ib_stream_parallel.sh
/usr/share/percona-xtrabackup-test/t/ib_stream_tar.sh
/usr/share/percona-xtrabackup-test/t/ib_stream_xbstream.sh
/usr/share/percona-xtrabackup-test/t/tar4ibd_symlink.sh
/usr/share/percona-xtrabackup-test/t/xb_basic.sh
/usr/share/percona-xtrabackup-test/t/xb_defaults_file.sh
/usr/share/percona-xtrabackup-test/t/xb_export.sh
/usr/share/percona-xtrabackup-test/t/xb_galera_info.sh
/usr/share/percona-xtrabackup-test/t/xb_incremental.sh
/usr/share/percona-xtrabackup-test/t/xb_incremental_compressed.sh
/usr/share/percona-xtrabackup-test/t/xb_log_overwrap.sh
/usr/share/percona-xtrabackup-test/t/xb_parallel.sh
/usr/share/percona-xtrabackup-test/t/xb_parallel_incremental.sh
/usr/share/percona-xtrabackup-test/t/xb_part_range.sh
/usr/share/percona-xtrabackup-test/t/xb_partial.sh
/usr/share/percona-xtrabackup-test/t/xb_perm_basic.sh
/usr/share/percona-xtrabackup-test/t/xb_perm_stream.sh
/usr/share/percona-xtrabackup-test/t/xb_stats.sh
/usr/share/percona-xtrabackup-test/t/xb_version.sh
[root@localhost ~]# innobackupex --help(查看innobackupex帮助)
Options:
    --apply-log
        Prepare a backup in BACKUP-DIR by applying the transaction log file
        named "xtrabackup_logfile" located in the same directory. Also,
        create new transaction logs. The InnoDB configuration is read from
        the file "backup-my.cnf".

    --compress
        This option instructs xtrabackup to compress backup copies of InnoDB
        data files. It is passed directly to the xtrabackup child process.
        Try 'xtrabackup --help' for more details.

    --compress-threads
        This option specifies the number of worker threads that will be used
        for parallel compression. It is passed directly to the xtrabackup
        child process. Try 'xtrabackup --help' for more details.

    --copy-back
        Copy all the files in a previously made backup from the backup
        directory to their original locations.

    --databases=LIST
        This option specifies the list of databases that innobackupex should
        back up. The option accepts a string argument. The list is of the
        form "databasename1[.table_name1] databasename2[.table_name2] . .
        .". If this option is not specified, all databases containing MyISAM
        and InnoDB tables will be backed up. Please make sure that
        --databases contains all of the InnoDB databases and tables, so that
        all of the innodb.frm files are also backed up. In case the list is
        very long, this can be specified in a file, and the full path of the
        file can be specified instead of the list. (See option
        --tables-file.)

    --defaults-file=[MY.CNF]
        This option specifies what file to read the default MySQL options
        from. The option accepts a string argument. It is also passed
        directly to xtrabackup's --defaults-file option. See the xtrabackup
        documentation for details.

    --export
        This option is passed directly to xtrabackup's --export option. It
        enables exporting individual tables for import into another server.
        See the xtrabackup documentation for details.

    --extra-lsndir=DIRECTORY
        This option specifies the directory in which to save an extra copy
        of the "xtrabackup_checkpoints" file. The option accepts a string
        argument. It is passed directly to xtrabackup's --extra-lsndir
        option. See the xtrabackup documentation for details.

    --force-tar
        This option forces the use of tar when creating a streamed backup,
        rather than tar4ibd, which is the default.

    --help
        This option displays a help screen and exits.

    --host=HOST
        This option specifies the host to use when connecting to the
        database server with TCP/IP. The option accepts a string argument.
        It is passed to the mysql child process without alteration. See
        mysql --help for details.

    --ibbackup=IBBACKUP-BINARY
        This option specifies which xtrabackup binary should be used. The
        option accepts a string argument. IBBACKUP-BINARY should be the
        command used to run XtraBackup. The option can be useful if the
        xtrabackup binary is not in your search path or working directory.
        If this option is not specified, innobackupex attempts to determine
        the binary to use automatically. By default, "xtrabackup" is the
        command used. However, when option --copy-back is specified,
        "xtrabackup_51" is the command used. And when option --apply-log is
        specified, the binary is used whose name is in the file
        "xtrabackup_binary" in the backup directory, if that file exists.

    --include=REGEXP
        This option is a regular expression to be matched against table
        names in databasename.tablename format. It is passed directly to
        xtrabackup's --tables option. See the xtrabackup documentation for
        details.

    --incremental
        This option tells xtrabackup to create an incremental backup, rather
        than a full one. It is passed to the xtrabackup child process. When
        this option is specified, either --incremental-lsn or
        --incremental-basedir can also be given. If neither option is given,
        option --incremental-basedir is passed to xtrabackup by default, set
        to the first timestamped backup directory in the backup base
        directory.

    --incremental-basedir=DIRECTORY
        This option specifies the directory containing the full backup that
        is the base dataset for the incremental backup. The option accepts a
        string argument. It is used with the --incremental option.

    --incremental-dir=DIRECTORY
        This option specifies the directory where the incremental backup
        will be combined with the full backup to make a new full backup. The
        option accepts a string argument. It is used with the --incremental
        option.

    --incremental-lsn
        This option specifies the log sequence number (LSN) to use for the
        incremental backup. The option accepts a string argument. It is used
        with the --incremental option. It is used instead of specifying
        --incremental-basedir. For databases created by MySQL and Percona
        Server 5.0-series versions, specify the LSN as two 32-bit integers
        in high:low format. For databases created in 5.1 and later, specify
        the LSN as a single 64-bit integer.

    --no-lock
        Use this option to disable table lock with "FLUSH TABLES WITH READ
        LOCK". Use it only if ALL your tables are InnoDB and you DO NOT CARE
        about the binary log position of the backup.

    --no-timestamp
        This option prevents creation of a time-stamped subdirectory of the
        BACKUP-ROOT-DIR given on the command line. When it is specified, the
        backup is done in BACKUP-ROOT-DIR instead.

    --parallel=NUMBER-OF-THREADS
        This option specifies the number of threads the xtrabackup child
        process should use to back up files concurrently. The option accepts
        an integer argument. It is passed directly to xtrabackup's
        --parallel option. See the xtrabackup documentation for details.

    --password=WORD
        This option specifies the password to use when connecting to the
        database. It accepts a string argument. It is passed to the mysql
        child process without alteration. See mysql --help for details.

    --port=PORT(连接服务器使用端口)
        This option specifies the port to use when connecting to the
        database server with TCP/IP. The option accepts a string argument.
        It is passed to the mysql child process. It is passed to the mysql
        child process without alteration. See mysql --help for details.

    --redo-only
        This option is passed directly to xtrabackup's --apply-log-only
        option. This forces xtrabackup to skip the "rollback" phase and do a
        "redo" only. This is necessary if the backup will have incremental
        changes applied to it later. See the xtrabackup documentation for
        details.

    --remote-host=HOSTNAME
        This option is DEPRECATED and will be removed in Percona XtraBackup
        2.1. In Percona XtraBackup 2.0 and later, you should use streaming
        backups instead. This option specifies the remote host on which the
        backup files will be created, by using an ssh connection. The option
        accepts a string argument.

    --safe-slave-backup
        Stop slave SQL thread and wait to start backup until
        Slave_open_temp_tables in "SHOW STATUS" is zero. If there are no
        open temporary tables, the backup will take place, otherwise the SQL
        thread will be started and stopped until there are no open temporary
        tables. The backup will fail if Slave_open_temp_tables does not
        become zero after --safe-slave-backup-timeout seconds. The slave SQL
        thread will be restarted when the backup finishes.

    --safe-slave-backup-timeout
        How many seconds --safe-slave-backup should wait for
        Slave_open_temp_tables to become zero. (default 300)

    --scpopt=SCP-OPTIONS
        This option specifies the command line options to pass to scp when
        the option --remost-host is specified. The option accepts a string
        argument. If the option is not specified, the default options are
        "-Cp -c arcfour".

    --sshopt=SSH-OPTIONS
        This option specifies the command line options to pass to ssh when
        the option --remost-host is specified. The option accepts a string
        argument.

    --slave-info
        This option is useful when backing up a replication slave server. It
        prints the binary log position and name of the master server. It
        also writes this information to the "xtrabackup_slave_info" file as
        a "CHANGE MASTER" command. A new slave for this master can be set up
        by starting a slave server on this backup and issuing a "CHANGE
        MASTER" command with the binary log position saved in the
        "xtrabackup_slave_info" file.

    --socket=SOCKET
        This option specifies the socket to use when connecting to the local
        database server with a UNIX domain socket. The option accepts a
        string argument. It is passed to the mysql child process without
        alteration. See mysql --help for details.

    --stream=[tar|. . .]
        This option specifies the format in which to do the streamed backup.
        The option accepts a string argument. The backup will be done to
        STDOUT in the specified format. Currently, the only supported
        formats are tar and xbstream. This option is passed directly to
        xtrabackup's --stream option.

    --tables-file=FILE
        This option specifies the file in which there are a list of names of
        the form database. The option accepts a string argument.table, one
        per line. The option is passed directly to xtrabackup's
        --tables-file option.

    --throttle=IOS
        This option specifies a number of I/O operations (pairs of
        read+write) per second. It accepts an integer argument. It is passed
        directly to xtrabackup's --throttle option.

    --tmpdir=DIRECTORY
        This option specifies the location where a temporary file will be
        stored. The option accepts a string argument. It should be used when
        --remote-host or --stream is specified. For these options, the
        transaction log will first be stored to a temporary file, before
        streaming or copying to a remote host. This option specifies the
        location where that temporary file will be stored. If the option is
        not specifed, the default is to use the value of tmpdir read from
        the server configuration.

    --use-memory=B
        This option accepts a string argument that specifies the amount of
        memory in bytes for xtrabackup to use for crash recovery while
        preparing a backup. Multiples are supported providing the unit (e.g.
        1MB, 1GB). It is used only with the option --apply-log. It is passed
        directly to xtrabackup's --use-memory option. See the xtrabackup
        documentation for details.

    --user=NAME
        This option specifies the MySQL username used when connecting to the
        server, if that's not the current user. The option accepts a string
        argument. It is passed to the mysql child process without
        alteration. See mysql --help for details.

    --version
        This option displays the xtrabackup version and copyright notice and
        then exits.

[root@localhost ~]# innobackupex --user=root /backup/(备份数据到/backup目录,做完全备份)

InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy
and Percona Inc 2009-2012.  All Rights Reserved.

This software is published under
the GNU GENERAL PUBLIC LICENSE Version 2, June 1991.

160228 15:22:07  innobackupex: Starting mysql with options:  --user='root' --unbuffered --
160228 15:22:07  innobackupex: Connected to database with mysql child process (pid=16505)
160228 15:22:13  innobackupex: Connection to database server closed
IMPORTANT: Please check that the backup run completes successfully.(启动备份进程)
           At the end of a successful backup run innobackupex
           prints "completed OK!".

innobackupex: Using mysql  Ver 14.12 Distrib 5.0.77, for redhat-linux-gnu (i386) using readline 5.1
innobackupex: Using mysql server version Copyright (C) 2000-2008 MySQL AB

innobackupex: Created backup directory /backup/2016-02-28_15-22-13
160228 15:22:13  innobackupex: Starting mysql with options:  --user='root' --unbuffered --(连接mysql数据库)
160228 15:22:13  innobackupex: Connected to database with mysql child process (pid=16528)
160228 15:22:15  innobackupex: Connection to database server closed

160228 15:22:15  innobackupex: Starting ibbackup with command: xtrabackup_55(我们mysql是5.5的版本所有它调用了xtrabackup_55来执行备份) --backup
 --suspend-at-end --target-dir=/backup/2016-02-28_15-22-13
innobackupex: Waiting for ibbackup (pid=16534) to suspend
innobackupex: Suspend file '/backup/2016-02-28_15-22-13/xtrabackup_suspended'

xtrabackup_55 version 2.0.0 for Percona Server 5.5.16 Linux (i686) (revision id: 417)
xtrabackup: uses posix_fadvise().
xtrabackup: cd to /mydata/data
xtrabackup: Target instance is assumed as followings.
xtrabackup:   innodb_data_home_dir = ./
xtrabackup:   innodb_data_file_path = ibdata1:10M:autoextend(表空间文件配置)
xtrabackup:   innodb_log_group_home_dir = ./(事务文件组目录)
xtrabackup:   innodb_log_files_in_group = 2(组中几个文件)
xtrabackup:   innodb_log_file_size = 5242880(每单个文件多大)
160228 15:22:15 InnoDB: Using Linux native AIO
>> log scanned up to (1644909)
[01] Copying ./ibdata1 to /backup/2016-02-28_15-22-13/ibdata1
[01]        ...done
[01] Copying ./jiaowu/scores.ibd to /backup/2016-02-28_15-22-13/./jiaowu/scores.ibd
[01]        ...done
[01] Copying ./jiaowu/courses.ibd to /backup/2016-02-28_15-22-13/./jiaowu/courses.ibd
[01]        ...done
[01] Copying ./jiaowu/tutors.ibd to /backup/2016-02-28_15-22-13/./jiaowu/tutors.ibd
[01]        ...done
[01] Copying ./jiaowu/students.ibd to /backup/2016-02-28_15-22-13/./jiaowu/students.ibd
[01]        ...done

160228 15:22:17  innobackupex: Continuing after ibbackup has suspended
160228 15:22:17  innobackupex: Starting mysql with options:  --user='root' --unbuffered --
160228 15:22:17  innobackupex: Connected to database with mysql child process (pid=16548)
160228 15:22:19  innobackupex: Starting to lock all tables...
>> log scanned up to (1644909)
>> log scanned up to (1644909)
160228 15:22:29  innobackupex: All tables locked and flushed to disk

160228 15:22:29  innobackupex: Starting to backup .frm, .MRG, .MYD, .MYI,
innobackupex: .TRG, .TRN, .ARM, .ARZ, .CSM, .CSV and .opt files in
innobackupex: subdirectories of '/mydata/data'
innobackupex: Backing up files '/mydata/data/performance_schema/*.{frm,MYD,MYI,MRG,TRG,TRN,ARM,ARZ,CSM,CSV,opt,par}' (18 files)
innobackupex: Backing up file '/mydata/data/jiaowu/courses.frm'
innobackupex: Backing up file '/mydata/data/jiaowu/students.frm'
innobackupex: Backing up file '/mydata/data/jiaowu/db.opt'
innobackupex: Backing up file '/mydata/data/jiaowu/tutors.frm'
innobackupex: Backing up file '/mydata/data/jiaowu/scores.frm'
innobackupex: Backing up file '/mydata/data/mydb/db.opt'
innobackupex: Backing up files '/mydata/data/mysql/*.{frm,MYD,MYI,MRG,TRG,TRN,ARM,ARZ,CSM,CSV,opt,par}' (72 files)
160228 15:22:29  innobackupex: Finished backing up .frm, .MRG, .MYD, .MYI, .TRG, .TRN, .ARM, .ARZ, .CSV, .CSM and .opt files

innobackupex: Resuming ibbackup

xtrabackup: The latest check point (for incremental): '1644909'
xtrabackup: Stopping log copying thread.
.>> log scanned up to (1644909)

xtrabackup: Transaction log of lsn (1644909) to (1644909) was copied.
160228 15:22:32  innobackupex: All tables unlocked
160228 15:22:32  innobackupex: Connection to database server closed

innobackupex: Backup created in directory '/backup/2016-02-28_15-22-13'(在备份目录下创建一个以当前这一刻时间命名的目录)
innobackupex: MySQL binlog position: filename 'mysql-bin.000001', position 107		
160228 15:22:32  innobackupex: completed OK!
[root@localhost ~]# cd /backup/(切换到/backup目录)
[root@localhost backup]# ls(查看当前目录文件及子目录)
2016-02-28_15-22-13  full-backup-2016-02-28  incremental-2016-02-28-13-43-01.sql  master2016-02-28.info  master.info
[root@localhost backup]# cd 2016-02-28_15-22-13/(切换到2016-02-28_15-22-13/目录)
[root@localhost 2016-02-28_15-22-13]# ls(查看当前目录文件及子目录)
backup-my.cnf(配置文件)  ibdata1(表空间文件)  jiaowu  mydb  mysql  performance_schema  test  xtrabackup_binary(备份时候使用那个命令执行操作)
xtrabackup_binlog_info(二进制日志信息)  xtrabackup_checkpoints  xtrabackup_logfile(数据文件)
[root@localhost 2016-02-28_15-22-13]# file xtrabackup_binlog_info(查看xtrabackup_binlog_info文件类型)
xtrabackup_binlog_info: ASCII text
[root@localhost 2016-02-28_15-22-13]# cat xtrabackup_binlog_info(查看xtrabackup_binlog_info文件内容)
mysql-bin.000001	107	
提示:备份那一刻二进制文件名及其position;
[root@localhost 2016-02-28_15-22-13]# file xtrabackup_binary(查看xtrabackup_binary文件类型)
xtrabackup_binary: ASCII text, with no line terminators
[root@localhost 2016-02-28_15-22-13]# cat xtrabackup_binary(查看xtrabackup_binary文件内容)
xtrabackup_55(备份时候使用那个命令执行操作)
xtrabackup_55[root@localhost 2016-02-28_15-22-13]# file xtrabackup_logfile(查看xtrabackup_logfile文件类型)
xtrabackup_logfile: data(数据文件)
[root@localhost 2016-02-28_15-22-13]# file xtrabackup_checkpoints(查看xtrabackup_checkpoints文件类型) 
xtrabackup_checkpoints: Bio-Rad .PIC Image File 24930 x 27491, 28789 images in file
[root@localhost 2016-02-28_15-22-13]# cat xtrabackup_checkpoints(查看xtrabackup_checkpoints文件内容)
backup_type = full-backuped(备份类型,完全备份)
from_lsn = 0(从逻辑号码开始的备份,lsn表示innodb存储引擎开始的每一个数据块,innodb存储引擎是要存储在磁盘上它有数据块,每一个数据块都有一个日志序列号,inn
odb存储引擎会在自己内部维持着记录着当前每一个数据块的日志序列号,如果块上数据发生了改变,这个号码会往前走一次,所以下次可以根据这个号码做增量备份,如果某个块发
生改变,它就把那个块备份一下,如果没有发生改变就不再备份了,所以它能实现对Innodb存储引擎做增量备份)
to_lsn = 1644909(结束数据块)
last_lsn = 1644909(最后数据库)
[root@localhost 2016-02-28_15-22-13]# innobackupex --apply-log /backup/2016-02-28_15-22-13/(回滚未提交的事务及同步已经提交的事务至数据文件)
[root@localhost ~]# mysql(连接mysql)
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 5.5.28-log Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> USE jiaowu;(修改默认数据库为jiaowu)
Database changed
mysql> INSERT INTO tutors (Tname) VALUES ('stu0005');(向tuors表Tname字段插入数据)
Query OK, 1 row affected (0.04 sec)

mysql> INSERT INTO tutors (Tname) VALUES ('stu0006');(向tutors表Tname字段插入数据)
Query OK, 1 row affected (0.01 sec)

mysql> \q(退出)
Bye

[root@localhost ~]# ls(查看当前目录文件及子目录)
alldatabases.sql  a.sql               install.log         mon-incremental.sql  percona-xtrabackup-2.0.0-417.rhel5.i386.rpm  studb.sql
all.sql           cmake-2.8.8         install.log.syslog  mysql-5.5.28         studb-2016-02-28-01-55-28.sql                temp.sql
anaconda-ks.cfg   cmake-2.8.8.tar.gz  jiaowu.sql          mysql-5.5.28.tar.gz  studb-2016-02-28-01-58-50.sql                test.sql
[root@localhost ~]# cd /mydata/data/(切换到/mydata/data目录)
[root@localhost data]# ls(查看当前目录文件及子目录)
ibdata1      ib_logfile1  localhost.localdomain.err  mydb   mysql-bin.000001  performance_schema
ib_logfile0  jiaowu       localhost.localdomain.pid  mysql  mysql-bin.index   test
[root@localhost data]# mysql(连接mysql数据库)       
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 5.5.28-log Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> FLUSH LOGS;(手动滚动一次二进制日志)
Query OK, 0 rows affected (0.22 sec)

mysql> \q
Bye

[root@localhost data]# ls(查看当前目录文件及子目录)
ibdata1      ib_logfile1  localhost.localdomain.err  mydb   mysql-bin.000001  mysql-bin.index     test
ib_logfile0  jiaowu       localhost.localdomain.pid  mysql  mysql-bin.000002  performance_schema
[root@localhost data]# cp mysql-bin.000001 /root/(复制mysql-bin.000001到/root目录)
[root@localhost data]# service mysqld stop(停止mysqld服务)
Shutting down MySQL.                                       [  OK  ]
[root@localhost data]# rm -rf ./*(删除当前目录所有文件,-r递归删除,-f强制删除)
[root@localhost data]# ls(查看当前目录文件及子目录)
[root@localhost data]# cd(切换到用户家目录)
提示:xtrabackupup执行备份还原是要求需要依赖于mysql服务器处于正常启动的,所以现在直接拿来还原不可以,还要先启动mysql数据库;
[root@localhost ~]# cd /usr/local/mysql/(切换到/usr/local/mysql目录)
[root@localhost mysql]# scripts/mysql_install_db --user=mysql --datadir=/mydata/data(初始化mysql,--user运行mysql进程用户,--datadir数据目录)
Installing MySQL system tables...
OK
Filling help tables...
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

./bin/mysqladmin -u root password 'new-password'
./bin/mysqladmin -u root -h localhost.localdomain password 'new-password'

Alternatively you can run:
./bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:
cd . ; ./bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd ./mysql-test ; perl mysql-test-run.pl

Please report any problems with the ./bin/mysqlbug script!
[root@localhost mysql]# service mysqld start(启动mysqld服务)
Starting MySQL...                                          [  OK  ]
[root@localhost mysql]# cd(切换到用户家目录)
提示:备份的时候需要启动,恢复不需要启动;
[root@localhost ~]# cd /mydata/data/(切换到/mydata/data目录)
[root@localhost data]# ls
ibdata1      ib_logfile1                mysql             mysql-bin.000002  mysql-bin.index     test
ib_logfile0  localhost.localdomain.err  mysql-bin.000001  mysql-bin.000003  performance_schema
[root@localhost data]# service mysqld stop(停止mysqld服务)
Shutting down MySQL.                                       [  OK  ]
[root@localhost data]# ls(查看当前目录文件及子目录)
ibdata1      ib_logfile1                mysql             mysql-bin.000002  mysql-bin.index     test
ib_logfile0  localhost.localdomain.err  mysql-bin.000001  mysql-bin.000003  performance_schema
[root@localhost data]# rm -rf ./*(删除当前目录下所有文件,-r递归删除,-f强制删除)
[root@localhost data]# ls(查看当前目录文件及子目录)
[root@localhost data]# cd(切换到用户家目录)
[root@localhost ~]# innobackupex --copy-back /backup/2016-02-28_15-22-13/(恢复数据,--copy-back指定备份的目录)

InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy
and Percona Inc 2009-2012.  All Rights Reserved.

This software is published under
the GNU GENERAL PUBLIC LICENSE Version 2, June 1991.

IMPORTANT: Please check that the copy-back run completes successfully.
           At the end of a successful copy-back run innobackupex
           prints "completed OK!".

innobackupex: Starting to copy files in '/backup/2016-02-28_15-22-13'
innobackupex: back to original data directory '/mydata/data'
innobackupex: Copying file '/mydata/data/ib_logfile1'
innobackupex: Copying file '/mydata/data/ib_logfile0'
innobackupex: Copying file '/mydata/data/xtrabackup_checkpoints'
innobackupex: Copying file '/mydata/data/xtrabackup_binlog_pos_innodb'
innobackupex: Creating directory '/mydata/data/jiaowu'
innobackupex: Copying file '/mydata/data/students.ibd'
innobackupex: Copying file '/mydata/data/scores.frm'
innobackupex: Copying file '/mydata/data/courses.frm'
innobackupex: Copying file '/mydata/data/courses.ibd'
innobackupex: Copying file '/mydata/data/students.frm'
innobackupex: Copying file '/mydata/data/tutors.ibd'
innobackupex: Copying file '/mydata/data/scores.ibd'
innobackupex: Copying file '/mydata/data/tutors.frm'
innobackupex: Copying file '/mydata/data/db.opt'
innobackupex: Creating directory '/mydata/data/test'
innobackupex: Creating directory '/mydata/data/performance_schema'
innobackupex: Copying file '/mydata/data/file_instances.frm'
innobackupex: Copying file '/mydata/data/rwlock_instances.frm'
innobackupex: Copying file '/mydata/data/file_summary_by_instance.frm'
innobackupex: Copying file '/mydata/data/performance_timers.frm'
innobackupex: Copying file '/mydata/data/events_waits_summary_global_by_event_name.frm'
innobackupex: Copying file '/mydata/data/events_waits_summary_by_instance.frm'
innobackupex: Copying file '/mydata/data/setup_instruments.frm'
innobackupex: Copying file '/mydata/data/mutex_instances.frm'
innobackupex: Copying file '/mydata/data/cond_instances.frm'
innobackupex: Copying file '/mydata/data/threads.frm'
innobackupex: Copying file '/mydata/data/events_waits_history.frm'
innobackupex: Copying file '/mydata/data/setup_timers.frm'
innobackupex: Copying file '/mydata/data/events_waits_history_long.frm'
innobackupex: Copying file '/mydata/data/events_waits_summary_by_thread_by_event_name.frm'
innobackupex: Copying file '/mydata/data/setup_consumers.frm'
innobackupex: Copying file '/mydata/data/file_summary_by_event_name.frm'
innobackupex: Copying file '/mydata/data/events_waits_current.frm'
innobackupex: Copying file '/mydata/data/db.opt'
innobackupex: Creating directory '/mydata/data/mysql'
innobackupex: Copying file '/mydata/data/time_zone_name.frm'
innobackupex: Copying file '/mydata/data/time_zone.MYI'
innobackupex: Copying file '/mydata/data/plugin.MYI'
innobackupex: Copying file '/mydata/data/time_zone_name.MYI'
innobackupex: Copying file '/mydata/data/proc.MYD'
innobackupex: Copying file '/mydata/data/servers.MYD'
innobackupex: Copying file '/mydata/data/time_zone_name.MYD'
innobackupex: Copying file '/mydata/data/plugin.frm'
innobackupex: Copying file '/mydata/data/proxies_priv.frm'
innobackupex: Copying file '/mydata/data/proxies_priv.MYI'
innobackupex: Copying file '/mydata/data/columns_priv.MYD'
innobackupex: Copying file '/mydata/data/time_zone_leap_second.frm'
innobackupex: Copying file '/mydata/data/time_zone_leap_second.MYD'
innobackupex: Copying file '/mydata/data/help_keyword.frm'
innobackupex: Copying file '/mydata/data/host.frm'
innobackupex: Copying file '/mydata/data/user.frm'
innobackupex: Copying file '/mydata/data/func.MYD'
innobackupex: Copying file '/mydata/data/tables_priv.MYI'
innobackupex: Copying file '/mydata/data/ndb_binlog_index.frm'
innobackupex: Copying file '/mydata/data/slow_log.CSV'
innobackupex: Copying file '/mydata/data/proxies_priv.MYD'
innobackupex: Copying file '/mydata/data/ndb_binlog_index.MYI'
innobackupex: Copying file '/mydata/data/db.MYD'
innobackupex: Copying file '/mydata/data/columns_priv.MYI'
innobackupex: Copying file '/mydata/data/ndb_binlog_index.MYD'
innobackupex: Copying file '/mydata/data/procs_priv.MYD'
innobackupex: Copying file '/mydata/data/time_zone_transition_type.frm'
innobackupex: Copying file '/mydata/data/user.MYD'
innobackupex: Copying file '/mydata/data/plugin.MYD'
innobackupex: Copying file '/mydata/data/time_zone_transition_type.MYI'
innobackupex: Copying file '/mydata/data/event.frm'
innobackupex: Copying file '/mydata/data/help_relation.MYI'
innobackupex: Copying file '/mydata/data/help_category.MYD'
innobackupex: Copying file '/mydata/data/columns_priv.frm'
innobackupex: Copying file '/mydata/data/procs_priv.MYI'
innobackupex: Copying file '/mydata/data/func.MYI'
innobackupex: Copying file '/mydata/data/help_category.MYI'
innobackupex: Copying file '/mydata/data/general_log.CSM'
innobackupex: Copying file '/mydata/data/help_topic.MYI'
innobackupex: Copying file '/mydata/data/help_relation.MYD'
innobackupex: Copying file '/mydata/data/proc.frm'
innobackupex: Copying file '/mydata/data/db.MYI'
innobackupex: Copying file '/mydata/data/help_topic.MYD'
innobackupex: Copying file '/mydata/data/event.MYD'
innobackupex: Copying file '/mydata/data/time_zone_transition.MYD'
innobackupex: Copying file '/mydata/data/general_log.frm'
innobackupex: Copying file '/mydata/data/slow_log.frm'
innobackupex: Copying file '/mydata/data/event.MYI'
innobackupex: Copying file '/mydata/data/slow_log.CSM'
innobackupex: Copying file '/mydata/data/user.MYI'
innobackupex: Copying file '/mydata/data/tables_priv.MYD'
innobackupex: Copying file '/mydata/data/time_zone_leap_second.MYI'
innobackupex: Copying file '/mydata/data/func.frm'
innobackupex: Copying file '/mydata/data/time_zone.frm'
innobackupex: Copying file '/mydata/data/time_zone_transition.MYI'
innobackupex: Copying file '/mydata/data/proc.MYI'
innobackupex: Copying file '/mydata/data/tables_priv.frm'
innobackupex: Copying file '/mydata/data/procs_priv.frm'
innobackupex: Copying file '/mydata/data/host.MYI'
innobackupex: Copying file '/mydata/data/time_zone_transition_type.MYD'
innobackupex: Copying file '/mydata/data/time_zone.MYD'
innobackupex: Copying file '/mydata/data/host.MYD'
innobackupex: Copying file '/mydata/data/servers.frm'
innobackupex: Copying file '/mydata/data/help_keyword.MYI'
innobackupex: Copying file '/mydata/data/help_relation.frm'
innobackupex: Copying file '/mydata/data/help_topic.frm'
innobackupex: Copying file '/mydata/data/help_keyword.MYD'
innobackupex: Copying file '/mydata/data/time_zone_transition.frm'
innobackupex: Copying file '/mydata/data/db.frm'
innobackupex: Copying file '/mydata/data/general_log.CSV'
innobackupex: Copying file '/mydata/data/servers.MYI'
innobackupex: Copying file '/mydata/data/help_category.frm'
innobackupex: Creating directory '/mydata/data/mydb'
innobackupex: Copying file '/mydata/data/db.opt'

innobackupex: Starting to copy InnoDB system tablespace
innobackupex: in '/backup/2016-02-28_15-22-13'
innobackupex: back to original InnoDB data directory '/mydata/data'
innobackupex: Copying file '/backup/2016-02-28_15-22-13/ibdata1'

innobackupex: Starting to copy InnoDB log files
innobackupex: in '/backup/2016-02-28_15-22-13'
innobackupex: back to original InnoDB log directory '/mydata/data'
innobackupex: Finished copying back files.

160228 16:22:56  innobackupex: completed OK!

提示:恢复数据不需要启动服务;
[root@localhost ~]# cd /mydata/data/(切换到/mydata/data目录)
[root@localhost data]# ls(查看当前目录文件及子目录)
ibdata1  ib_logfile0  ib_logfile1  jiaowu  mydb  mysql  performance_schema  test  xtrabackup_binlog_pos_innodb  xtrabackup_checkpoints
[root@localhost data]# ll(查看当前目录文件及子目录详细信息)
total 28788
-rw-r----- 1 root root 18874368 Feb 28 15:55 ibdata1
-rw-r--r-- 1 root root  5242880 Feb 28 16:22 ib_logfile0
-rw-r--r-- 1 root root  5242880 Feb 28 16:22 ib_logfile1
drwxr-xr-x 2 root root     4096 Feb 28 16:22 jiaowu
drwxr-xr-x 2 root root     4096 Feb 28 16:22 mydb
drwxr-xr-x 2 root root     4096 Feb 28 16:22 mysql
drwxr-xr-x 2 root root     4096 Feb 28 16:22 performance_schema
drwxr-xr-x 2 root root     4096 Feb 28 16:22 test
-rw-r--r-- 1 root root       23 Feb 28 16:22 xtrabackup_binlog_pos_innodb
-rw-r--r-- 1 root root       77 Feb 28 16:22 xtrabackup_checkpoints
提示:恢复回来的文件的属主属组未必是正确的,所以我们还需要把恢复回来的数据属主数组改为mysql;
[root@localhost data]# pwd(查看当前所处的目录)
/mydata/data
[root@localhost data]# chown -R mysql.mysql ./*(更改当前目录下所有文件属主属组为mysql,-R递归更改)
[root@localhost data]# ll(查看当前目录文件及子目录详细信息)
total 28788
-rw-r----- 1 mysql mysql 18874368 Feb 28 15:55 ibdata1
-rw-r--r-- 1 mysql mysql  5242880 Feb 28 16:22 ib_logfile0
-rw-r--r-- 1 mysql mysql  5242880 Feb 28 16:22 ib_logfile1
drwxr-xr-x 2 mysql mysql     4096 Feb 28 16:22 jiaowu
drwxr-xr-x 2 mysql mysql     4096 Feb 28 16:22 mydb
drwxr-xr-x 2 mysql mysql     4096 Feb 28 16:22 mysql
drwxr-xr-x 2 mysql mysql     4096 Feb 28 16:22 performance_schema
drwxr-xr-x 2 mysql mysql     4096 Feb 28 16:22 test
-rw-r--r-- 1 mysql mysql       23 Feb 28 16:22 xtrabackup_binlog_pos_innodb
-rw-r--r-- 1 mysql mysql       77 Feb 28 16:22 xtrabackup_checkpoints
[root@localhost data]# service mysqld start(启动mysqld服务)
Starting MySQL..                                           [  OK  ]
[root@localhost data]# mysql(连接mysql数据库)
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.5.28-log Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> SHOW DATABASES;(显示数据库)
+--------------------+
| Database           |
+--------------------+
| information_schema | 
| jiaowu             | 
| mydb               | 
| mysql              | 
| performance_schema | 
| test               | 
+--------------------+
6 rows in set (0.00 sec)

mysql> USE jiaowu;(修改默认数据库为jiaowu)
Database changed

mysql> SELECT * FROM tutors;(查询tutors表所有字段数据)
+-----+--------------+--------+------+
| TID | Tname        | Gender | Age  |
+-----+--------------+--------+------+
|   1 | HongQigong   | M      |   93 | 
|   2 | HuangYaoshi  | M      |   63 | 
|   3 | Miejueshitai | F      |   72 | 
|   4 | OuYangfeng   | M      |   76 | 
|   5 | YiDeng       | M      |   90 | 
|   6 | YuCanghai    | M      |   56 | 
|   7 | Jinlunfawang | M      |   67 | 
|   8 | HuYidao      | M      |   42 | 
|   9 | NingZhongze  | F      |   49 | 
|  10 | stu001       | M      | NULL | 
|  11 | stu002       | M      | NULL | 
|  12 | stu003       | M      | NULL | 
|  13 | stu004       | M      | NULL | 
+-----+--------------+--------+------+
13 rows in set (0.00 sec)

mysql> \q(退出)
Bye

[root@localhost data]# cd(切换到用户家目录)
[root@localhost ~]# mysqlbinlog /root/mysql-bin.000001 > /tmp/abc.sql(读取mysql-bin.000001二进制日志将内容保存到/tmp目录abc.sql文件)
[root@localhost ~]# mysql(连接mysql)
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.5.28-log Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> SET sql_log_bin=0;(关闭记录二进制日志)
Query OK, 0 rows affected (0.00 sec)

mysql> SOURCE /tmp/abc.sql(执行abc.sql脚步到mysql)
Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Charset changed
Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Database changed
Query OK, 0 rows affected (0.00 sec)

Query OK, 1 row affected (0.00 sec)

Query OK, 0 rows affected (0.01 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.01 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 1 row affected (0.01 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

mysql> SET sql_log_bin=1;(开启记录二进制日志功能)
Query OK, 0 rows affected (0.00 sec)

mysql> USE jiaowu;(修改默认数据库为jiaowu)
Database changed

mysql> SELECT * FROM tutors;(查询tutors表所有字段数据)
+-----+--------------+--------+------+
| TID | Tname        | Gender | Age  |
+-----+--------------+--------+------+
|   1 | HongQigong   | M      |   93 | 
|   2 | HuangYaoshi  | M      |   63 | 
|   3 | Miejueshitai | F      |   72 | 
|   4 | OuYangfeng   | M      |   76 | 
|   5 | YiDeng       | M      |   90 | 
|   6 | YuCanghai    | M      |   56 | 
|   7 | Jinlunfawang | M      |   67 | 
|   8 | HuYidao      | M      |   42 | 
|   9 | NingZhongze  | F      |   49 | 
|  10 | stu001       | M      | NULL | 
|  11 | stu002       | M      | NULL | 
|  12 | stu003       | M      | NULL | 
|  13 | stu004       | M      | NULL | 
|  14 | stu0005      | M      | NULL | 
|  15 | stu0006      | M      | NULL | 
+-----+--------------+--------+------+
15 rows in set (0.00 sec)

mysql> INSERT INTO tutors (Tname) VALUES ('stu0007');(向tutors表的Tname字段插入数据)
Query OK, 1 row affected (0.01 sec)

mysql> INSERT INTO tutors (Tname) VALUES ('stu0008');(向tutors表的Tname字段插入数据)
Query OK, 1 row affected (0.01 sec)

mysql> \q(退出)
Bye

[root@localhost ~]# innobackupex --user=root /backup/(备份数据库,做完全备份)

InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy
and Percona Inc 2009-2012.  All Rights Reserved.

This software is published under
the GNU GENERAL PUBLIC LICENSE Version 2, June 1991.

160228 16:55:20  innobackupex: Starting mysql with options:  --user='root' --unbuffered --
160228 16:55:20  innobackupex: Connected to database with mysql child process (pid=18066)
160228 16:55:26  innobackupex: Connection to database server closed
IMPORTANT: Please check that the backup run completes successfully.
           At the end of a successful backup run innobackupex
           prints "completed OK!".

innobackupex: Using mysql  Ver 14.12 Distrib 5.0.77, for redhat-linux-gnu (i386) using readline 5.1
innobackupex: Using mysql server version Copyright (C) 2000-2008 MySQL AB

innobackupex: Created backup directory /backup/2016-02-28_16-55-26
160228 16:55:26  innobackupex: Starting mysql with options:  --user='root' --unbuffered --
160228 16:55:26  innobackupex: Connected to database with mysql child process (pid=18089)
160228 16:55:28  innobackupex: Connection to database server closed

160228 16:55:28  innobackupex: Starting ibbackup with command: xtrabackup_55 --backup --suspend-at-end --target-dir=/backup/2016-02-28_
16-55-26
innobackupex: Waiting for ibbackup (pid=18095) to suspend
innobackupex: Suspend file '/backup/2016-02-28_16-55-26/xtrabackup_suspended'

xtrabackup_55 version 2.0.0 for Percona Server 5.5.16 Linux (i686) (revision id: 417)
xtrabackup: uses posix_fadvise().
xtrabackup: cd to /mydata/data
xtrabackup: Target instance is assumed as followings.
xtrabackup:   innodb_data_home_dir = ./
xtrabackup:   innodb_data_file_path = ibdata1:10M:autoextend
xtrabackup:   innodb_log_group_home_dir = ./
xtrabackup:   innodb_log_files_in_group = 2
xtrabackup:   innodb_log_file_size = 5242880
160228 16:55:29 InnoDB: Using Linux native AIO
>> log scanned up to (1648427)
[01] Copying ./ibdata1 to /backup/2016-02-28_16-55-26/ibdata1
[01]        ...done
[01] Copying ./jiaowu/scores.ibd to /backup/2016-02-28_16-55-26/./jiaowu/scores.ibd
[01]        ...done
[01] Copying ./jiaowu/courses.ibd to /backup/2016-02-28_16-55-26/./jiaowu/courses.ibd
[01]        ...done
[01] Copying ./jiaowu/tutors.ibd to /backup/2016-02-28_16-55-26/./jiaowu/tutors.ibd
[01]        ...done
[01] Copying ./jiaowu/students.ibd to /backup/2016-02-28_16-55-26/./jiaowu/students.ibd
[01]        ...done

160228 16:55:32  innobackupex: Continuing after ibbackup has suspended
160228 16:55:32  innobackupex: Starting mysql with options:  --user='root' --unbuffered --
160228 16:55:32  innobackupex: Connected to database with mysql child process (pid=18109)
>> log scanned up to (1648427)
160228 16:55:35  innobackupex: Starting to lock all tables...
>> log scanned up to (1648427)
>> log scanned up to (1648427)
160228 16:55:45  innobackupex: All tables locked and flushed to disk

160228 16:55:45  innobackupex: Starting to backup .frm, .MRG, .MYD, .MYI,
innobackupex: .TRG, .TRN, .ARM, .ARZ, .CSM, .CSV and .opt files in
innobackupex: subdirectories of '/mydata/data'
innobackupex: Backing up files '/mydata/data/performance_schema/*.{frm,MYD,MYI,MRG,TRG,TRN,ARM,ARZ,CSM,CSV,opt,par}' (18 files)
innobackupex: Backing up file '/mydata/data/jiaowu/courses.frm'
innobackupex: Backing up file '/mydata/data/jiaowu/students.frm'
innobackupex: Backing up file '/mydata/data/jiaowu/db.opt'
innobackupex: Backing up file '/mydata/data/jiaowu/tutors.frm'
innobackupex: Backing up file '/mydata/data/jiaowu/scores.frm'
innobackupex: Backing up file '/mydata/data/mydb/db.opt'
innobackupex: Backing up files '/mydata/data/mysql/*.{frm,MYD,MYI,MRG,TRG,TRN,ARM,ARZ,CSM,CSV,opt,par}' (72 files)
160228 16:55:45  innobackupex: Finished backing up .frm, .MRG, .MYD, .MYI, .TRG, .TRN, .ARM, .ARZ, .CSV, .CSM and .opt files

innobackupex: Resuming ibbackup

xtrabackup: The latest check point (for incremental): '1648427'
xtrabackup: Stopping log copying thread.
.>> log scanned up to (1648427)

xtrabackup: Transaction log of lsn (1648427) to (1648427) was copied.
160228 16:55:47  innobackupex: All tables unlocked
160228 16:55:47  innobackupex: Connection to database server closed

innobackupex: Backup created in directory '/backup/2016-02-28_16-55-26'
innobackupex: MySQL binlog position: filename 'mysql-bin.000001', position 577		
160228 16:55:47  innobackupex: completed OK!

[root@localhost ~]# mysql(连接mysql)
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 6
Server version: 5.5.28-log Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> USE jiaowu;(修改默认数据库)
Database changed

mysql> INSERT INTO tutors (Tname) VALUES ('stu0009');(向tutors表的Tname字段插入数据)
Query OK, 1 row affected (0.01 sec)

mysql> INSERT INTO tutors (Tname) VALUES ('stu0010');(向tutors表的Tname字段插入数据)
Query OK, 1 row affected (0.01 sec)

mysql> \q(退出)
Bye

提示:这些新数据要么使用二进制日志记录,要么使用增量备份进行记录;

[root@localhost ~]# innobackupex --incremental /backup/ --incremental-basedir=/backup/2016-02-28_16-55-26/(--incremental做增量备份,--
incremental-basedir指定针对那个完全备份做增量备份)

InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy
and Percona Inc 2009-2012.  All Rights Reserved.

This software is published under
the GNU GENERAL PUBLIC LICENSE Version 2, June 1991.

160228 17:01:44  innobackupex: Starting mysql with options:  --unbuffered --
160228 17:01:44  innobackupex: Connected to database with mysql child process (pid=18279)
160228 17:01:50  innobackupex: Connection to database server closed
IMPORTANT: Please check that the backup run completes successfully.
           At the end of a successful backup run innobackupex
           prints "completed OK!".

innobackupex: Using mysql  Ver 14.12 Distrib 5.0.77, for redhat-linux-gnu (i386) using readline 5.1
innobackupex: Using mysql server version Copyright (C) 2000-2008 MySQL AB

innobackupex: Created backup directory /backup/2016-02-28_17-01-50
160228 17:01:50  innobackupex: Starting mysql with options:  --unbuffered --
160228 17:01:50  innobackupex: Connected to database with mysql child process (pid=18302)
160228 17:01:52  innobackupex: Connection to database server closed

160228 17:01:52  innobackupex: Starting ibbackup with command: xtrabackup_55 --backup --suspend-at-end --target-dir=/backup/2016-02-28_
17-01-50 --incremental-basedir='/backup/2016-02-28_16-55-26/'
innobackupex: Waiting for ibbackup (pid=18308) to suspend
innobackupex: Suspend file '/backup/2016-02-28_17-01-50/xtrabackup_suspended'

xtrabackup_55 version 2.0.0 for Percona Server 5.5.16 Linux (i686) (revision id: 417)
incremental backup from 1648427 is enabled.
xtrabackup: uses posix_fadvise().
xtrabackup: cd to /mydata/data
xtrabackup: Target instance is assumed as followings.
xtrabackup:   innodb_data_home_dir = ./
xtrabackup:   innodb_data_file_path = ibdata1:10M:autoextend
xtrabackup:   innodb_log_group_home_dir = ./
xtrabackup:   innodb_log_files_in_group = 2
xtrabackup:   innodb_log_file_size = 5242880
160228 17:01:52 InnoDB: Using Linux native AIO
>> log scanned up to (1648997)
[01] Copying ./ibdata1 to /backup/2016-02-28_17-01-50/ibdata1.delta
[01]        ...done
[01] Copying ./jiaowu/scores.ibd to /backup/2016-02-28_17-01-50/./jiaowu/scores.ibd.delta
[01]        ...done
[01] Copying ./jiaowu/courses.ibd to /backup/2016-02-28_17-01-50/./jiaowu/courses.ibd.delta
[01]        ...done
[01] Copying ./jiaowu/tutors.ibd to /backup/2016-02-28_17-01-50/./jiaowu/tutors.ibd.delta
[01]        ...done
[01] Copying ./jiaowu/students.ibd to /backup/2016-02-28_17-01-50/./jiaowu/students.ibd.delta
[01]        ...done

160228 17:01:56  innobackupex: Continuing after ibbackup has suspended
160228 17:01:56  innobackupex: Starting mysql with options:  --unbuffered --
160228 17:01:56  innobackupex: Connected to database with mysql child process (pid=18322)
>> log scanned up to (1648997)
160228 17:01:58  innobackupex: Starting to lock all tables...
>> log scanned up to (1648997)
>> log scanned up to (1648997)
160228 17:02:08  innobackupex: All tables locked and flushed to disk

160228 17:02:08  innobackupex: Starting to backup .frm, .MRG, .MYD, .MYI,
innobackupex: .TRG, .TRN, .ARM, .ARZ, .CSM, .CSV and .opt files in
innobackupex: subdirectories of '/mydata/data'
innobackupex: Backing up files '/mydata/data/performance_schema/*.{frm,MYD,MYI,MRG,TRG,TRN,ARM,ARZ,CSM,CSV,opt,par}' (18 files)
innobackupex: Backing up file '/mydata/data/jiaowu/courses.frm'
innobackupex: Backing up file '/mydata/data/jiaowu/students.frm'
innobackupex: Backing up file '/mydata/data/jiaowu/db.opt'
innobackupex: Backing up file '/mydata/data/jiaowu/tutors.frm'
innobackupex: Backing up file '/mydata/data/jiaowu/scores.frm'
innobackupex: Backing up file '/mydata/data/mydb/db.opt'
innobackupex: Backing up files '/mydata/data/mysql/*.{frm,MYD,MYI,MRG,TRG,TRN,ARM,ARZ,CSM,CSV,opt,par}' (72 files)
160228 17:02:09  innobackupex: Finished backing up .frm, .MRG, .MYD, .MYI, .TRG, .TRN, .ARM, .ARZ, .CSV, .CSM and .opt files

innobackupex: Resuming ibbackup

xtrabackup: The latest check point (for incremental): '1648997'
xtrabackup: Stopping log copying thread.
.>> log scanned up to (1648997)

xtrabackup: Transaction log of lsn (1648997) to (1648997) was copied.
160228 17:02:12  innobackupex: All tables unlocked
160228 17:02:12  innobackupex: Connection to database server closed

innobackupex: Backup created in directory '/backup/2016-02-28_17-01-50'
innobackupex: MySQL binlog position: filename 'mysql-bin.000001', position 1047		
160228 17:02:12  innobackupex: completed OK!

[root@localhost ~]# mysql(连接mysql)
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 5.5.28-log Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> USE jiaowu;(修改默认数据库为jiaowu)
Database changed

mysql> INSERT INTO tutors (Tname) VALUES ('stu0011');(向tutors表的Tname字段插入数据)
Query OK, 1 row affected (0.01 sec)

mysql> INSERT INTO tutors (Tname) VALUES ('stu0012');(向tutors表的Tname字段插入数据)
Query OK, 1 row affected (0.05 sec)

mysql> \q(退出)
Bye

[root@localhost ~]# innobackupex --incremental /backup/ --incremental-basedir=/backup/2016-02-28_17-01-50/(--incremental增量备份,--incre
mental-basedir第二次做增量备份,需要将目录指向第一次做增量备份的目录)

InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy
and Percona Inc 2009-2012.  All Rights Reserved.

This software is published under
the GNU GENERAL PUBLIC LICENSE Version 2, June 1991.

160228 17:09:17  innobackupex: Starting mysql with options:  --unbuffered --
160228 17:09:17  innobackupex: Connected to database with mysql child process (pid=18464)
160228 17:09:24  innobackupex: Connection to database server closed
IMPORTANT: Please check that the backup run completes successfully.
           At the end of a successful backup run innobackupex
           prints "completed OK!".

innobackupex: Using mysql  Ver 14.12 Distrib 5.0.77, for redhat-linux-gnu (i386) using readline 5.1
innobackupex: Using mysql server version Copyright (C) 2000-2008 MySQL AB

innobackupex: Created backup directory /backup/2016-02-28_17-09-24
160228 17:09:24  innobackupex: Starting mysql with options:  --unbuffered --
160228 17:09:24  innobackupex: Connected to database with mysql child process (pid=18487)
160228 17:09:26  innobackupex: Connection to database server closed

160228 17:09:26  innobackupex: Starting ibbackup with command: xtrabackup_55 --backup --suspend-at-end --target-dir=/backup/2016-02-28_17
-09-24 --incremental-basedir='/backup/2016-02-28_17-01-50/'
innobackupex: Waiting for ibbackup (pid=18493) to suspend
innobackupex: Suspend file '/backup/2016-02-28_17-09-24/xtrabackup_suspended'

xtrabackup_55 version 2.0.0 for Percona Server 5.5.16 Linux (i686) (revision id: 417)
incremental backup from 1648997 is enabled.
xtrabackup: uses posix_fadvise().
xtrabackup: cd to /mydata/data
xtrabackup: Target instance is assumed as followings.
xtrabackup:   innodb_data_home_dir = ./
xtrabackup:   innodb_data_file_path = ibdata1:10M:autoextend
xtrabackup:   innodb_log_group_home_dir = ./
xtrabackup:   innodb_log_files_in_group = 2
xtrabackup:   innodb_log_file_size = 5242880
160228 17:09:26 InnoDB: Using Linux native AIO
>> log scanned up to (1650315)
[01] Copying ./ibdata1 to /backup/2016-02-28_17-09-24/ibdata1.delta
[01]        ...done
[01] Copying ./jiaowu/scores.ibd to /backup/2016-02-28_17-09-24/./jiaowu/scores.ibd.delta
[01]        ...done
[01] Copying ./jiaowu/courses.ibd to /backup/2016-02-28_17-09-24/./jiaowu/courses.ibd.delta
[01]        ...done
[01] Copying ./jiaowu/tutors.ibd to /backup/2016-02-28_17-09-24/./jiaowu/tutors.ibd.delta
[01]        ...done
[01] Copying ./jiaowu/students.ibd to /backup/2016-02-28_17-09-24/./jiaowu/students.ibd.delta
[01]        ...done

160228 17:09:28  innobackupex: Continuing after ibbackup has suspended
160228 17:09:28  innobackupex: Starting mysql with options:  --unbuffered --
160228 17:09:28  innobackupex: Connected to database with mysql child process (pid=18507)
160228 17:09:30  innobackupex: Starting to lock all tables...
>> log scanned up to (1650315)
>> log scanned up to (1650315)
160228 17:09:40  innobackupex: All tables locked and flushed to disk

160228 17:09:40  innobackupex: Starting to backup .frm, .MRG, .MYD, .MYI,
innobackupex: .TRG, .TRN, .ARM, .ARZ, .CSM, .CSV and .opt files in
innobackupex: subdirectories of '/mydata/data'
innobackupex: Backing up files '/mydata/data/performance_schema/*.{frm,MYD,MYI,MRG,TRG,TRN,ARM,ARZ,CSM,CSV,opt,par}' (18 files)
innobackupex: Backing up file '/mydata/data/jiaowu/courses.frm'
innobackupex: Backing up file '/mydata/data/jiaowu/students.frm'
innobackupex: Backing up file '/mydata/data/jiaowu/db.opt'
innobackupex: Backing up file '/mydata/data/jiaowu/tutors.frm'
innobackupex: Backing up file '/mydata/data/jiaowu/scores.frm'
innobackupex: Backing up file '/mydata/data/mydb/db.opt'
innobackupex: Backing up files '/mydata/data/mysql/*.{frm,MYD,MYI,MRG,TRG,TRN,ARM,ARZ,CSM,CSV,opt,par}' (72 files)
160228 17:09:40  innobackupex: Finished backing up .frm, .MRG, .MYD, .MYI, .TRG, .TRN, .ARM, .ARZ, .CSV, .CSM and .opt files

innobackupex: Resuming ibbackup

xtrabackup: The latest check point (for incremental): '1650315'
xtrabackup: Stopping log copying thread.
.>> log scanned up to (1650315)

xtrabackup: Transaction log of lsn (1650315) to (1650315) was copied.
160228 17:09:42  innobackupex: All tables unlocked
160228 17:09:42  innobackupex: Connection to database server closed

innobackupex: Backup created in directory '/backup/2016-02-28_17-09-24'
innobackupex: MySQL binlog position: filename 'mysql-bin.000001', position 1517		
160228 17:09:42  innobackupex: completed OK!

[root@localhost ~]# cd /backup/(切换到/backup目录)
[root@localhost backup]# ls(查看当前目录文件及子目录)
2016-02-28_15-22-13  2016-02-28_17-01-50  full-backup-2016-02-28               master2016-02-28.info
2016-02-28_16-55-26  2016-02-28_17-09-24  incremental-2016-02-28-13-43-01.sql  master.info
[root@localhost backup]# cd 2016-02-28_16-55-26/(切换到2016-02-28_16-55-26/目录)
[root@localhost 2016-02-28_16-55-26]# ls(查看当前目录文件及子目录)
backup-my.cnf  ibdata1  jiaowu  mydb  mysql  performance_schema  test  xtrabackup_binary  xtrabackup_binlog_info  xtrabackup_checkpoints
xtrabackup_logfile
[root@localhost 2016-02-28_16-55-26]# cat xtrabackup_checkpoints(查看xtrabackup_checkpoints文件内容)
backup_type = full-backuped(完全备份)
from_lsn = 0
to_lsn = 1648427
last_lsn = 1648427
[root@localhost 2016-02-28_16-55-26]# cd ../2016-02-28_17-01-50/(切换到/2016-02-28_17-01-50/目录)
[root@localhost 2016-02-28_17-01-50]# cat xtrabackup_checkpoints(查看xtrabackup_checkpoints文件内容)
backup_type = incremental(增量备份)
from_lsn = 1648427
to_lsn = 1648997
last_lsn = 1648997
[root@localhost 2016-02-28_17-01-50]# cd ../2016-02-28_17-09-24/(切换到/2016-02-28_17-09-24/目录)
[root@localhost 2016-02-28_17-09-24]# cat xtrabackup_checkpoints(查看xtrabackup_checkpoints文件内容)
backup_type = incremental(增量备份)
from_lsn = 1648997
to_lsn = 1650315
提示:所以每次增量备份都应该指向上次完全备份或者上次增量备份,如果此前尚未做过增量备份一定要指向完全备份,否则就应该指向最近一次的增量备份;
[root@localhost 2016-02-28_17-09-24]# cd(切换到用户家目录)
[root@localhost ~]# innobackupex --apply-log --redo-only /backup/2016-02-28_16-55-26/(准备完全备份,回滚未提交的事务及同步已经提交的事务至数据文件)

InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy
and Percona Inc 2009-2012.  All Rights Reserved.

This software is published under
the GNU GENERAL PUBLIC LICENSE Version 2, June 1991.

IMPORTANT: Please check that the apply-log run completes successfully.
           At the end of a successful apply-log run innobackupex
           prints "completed OK!".



160228 17:24:31  innobackupex: Starting ibbackup with command: xtrabackup_55 --prepare --target-dir=/backup/2016-02-28_16-55-26 --apply
-log-only

xtrabackup_55 version 2.0.0 for Percona Server 5.5.16 Linux (i686) (revision id: 417)
xtrabackup: cd to /backup/2016-02-28_16-55-26
xtrabackup: This target seems to be not prepared yet.
xtrabackup: xtrabackup_logfile detected: size=2097152, start_lsn=(1648427)
xtrabackup: Temporary instance for recovery is set as followings.
xtrabackup:   innodb_data_home_dir = ./
xtrabackup:   innodb_data_file_path = ibdata1:10M:autoextend
xtrabackup:   innodb_log_group_home_dir = ./
xtrabackup:   innodb_log_files_in_group = 1
xtrabackup:   innodb_log_file_size = 2097152
160228 17:24:31 InnoDB: Using Linux native AIO
xtrabackup: Starting InnoDB instance for recovery.
xtrabackup: Using 104857600 bytes for buffer pool (set by --use-memory parameter)
160228 17:24:31 InnoDB: The InnoDB memory heap is disabled
160228 17:24:31 InnoDB: Mutexes and rw_locks use GCC atomic builtins
160228 17:24:31 InnoDB: Compressed tables use zlib 1.2.3
160228 17:24:31 InnoDB: Using Linux native AIO
160228 17:24:31 InnoDB: Warning: innodb_file_io_threads is deprecated. Please use innodb_read_io_threads and innodb_write_io_threads instead
160228 17:24:31 InnoDB: Initializing buffer pool, size = 100.0M
160228 17:24:31 InnoDB: Completed initialization of buffer pool
160228 17:24:31 InnoDB: highest supported file format is Barracuda.
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
160228 17:24:31  InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Last MySQL binlog file position 0 577, file name ./mysql-bin.000001

[notice (again)]
  If you use binary log and don't use any hack of group commit,
  the binary log position seems to be:
InnoDB: Last MySQL binlog file position 0 577, file name ./mysql-bin.000001

xtrabackup: starting shutdown with innodb_fast_shutdown = 1
160228 17:24:31  InnoDB: Starting shutdown...
160228 17:24:32  InnoDB: Shutdown completed; log sequence number 1648427
160228 17:24:32  innobackupex: completed OK!

[root@localhost ~]# innobackupex --apply-log --redo-only /backup/2016-02-28_16-55-26/ --incremental-basedir=/backup/2016-02-28_17-01-50/
(准备增量备份,--incremental-basedri增量备份目录)

InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy
and Percona Inc 2009-2012.  All Rights Reserved.

This software is published under
the GNU GENERAL PUBLIC LICENSE Version 2, June 1991.

IMPORTANT: Please check that the apply-log run completes successfully.
           At the end of a successful apply-log run innobackupex
           prints "completed OK!".



160228 17:41:28  innobackupex: Starting ibbackup with command: xtrabackup_55 --prepare --target-dir=/backup/2016-02-28_16-55-26 --apply-
log-only

xtrabackup_55 version 2.0.0 for Percona Server 5.5.16 Linux (i686) (revision id: 417)
xtrabackup: cd to /backup/2016-02-28_16-55-26
xtrabackup: This target seems to be already prepared.
xtrabackup: notice: xtrabackup_logfile was already used to '--prepare'.
xtrabackup: Temporary instance for recovery is set as followings.
xtrabackup:   innodb_data_home_dir = ./
xtrabackup:   innodb_data_file_path = ibdata1:10M:autoextend
xtrabackup:   innodb_log_group_home_dir = ./
xtrabackup:   innodb_log_files_in_group = 2
xtrabackup:   innodb_log_file_size = 5242880
160228 17:41:28 InnoDB: Using Linux native AIO
xtrabackup: Starting InnoDB instance for recovery.
xtrabackup: Using 104857600 bytes for buffer pool (set by --use-memory parameter)
160228 17:41:28 InnoDB: The InnoDB memory heap is disabled
160228 17:41:28 InnoDB: Mutexes and rw_locks use GCC atomic builtins
160228 17:41:28 InnoDB: Compressed tables use zlib 1.2.3
160228 17:41:28 InnoDB: Using Linux native AIO
160228 17:41:28 InnoDB: Warning: innodb_file_io_threads is deprecated. Please use innodb_read_io_threads and innodb_write_io_threads instead
160228 17:41:28 InnoDB: Initializing buffer pool, size = 100.0M
160228 17:41:28 InnoDB: Completed initialization of buffer pool
160228 17:41:28  InnoDB: Log file ./ib_logfile0 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
160228 17:41:28  InnoDB: Log file ./ib_logfile1 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
160228 17:41:28 InnoDB: highest supported file format is Barracuda.
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
160228 17:41:28  InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Last MySQL binlog file position 0 577, file name ./mysql-bin.000001

[notice (again)]
  If you use binary log and don't use any hack of group commit,
  the binary log position seems to be:
InnoDB: Last MySQL binlog file position 0 577, file name ./mysql-bin.000001

xtrabackup: starting shutdown with innodb_fast_shutdown = 1
160228 17:41:28  InnoDB: Starting shutdown...
160228 17:41:29  InnoDB: Shutdown completed; log sequence number 1648652
160228 17:41:29  innobackupex: completed OK!

[root@localhost ~]# innobackupex --apply-log --redo-only /backup/2016-02-28_16-55-26/ --incremental-basedir=/backup/2016-02-28_17-09-24/
(准备第二次增量备份,--incremental-basedir增量备份目录)

InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy
and Percona Inc 2009-2012.  All Rights Reserved.

This software is published under
the GNU GENERAL PUBLIC LICENSE Version 2, June 1991.

IMPORTANT: Please check that the apply-log run completes successfully.
           At the end of a successful apply-log run innobackupex
           prints "completed OK!".



160228 17:42:59  innobackupex: Starting ibbackup with command: xtrabackup_55 --prepare --target-dir=/backup/2016-02-28_16-55-26 --apply-
log-only

xtrabackup_55 version 2.0.0 for Percona Server 5.5.16 Linux (i686) (revision id: 417)
xtrabackup: cd to /backup/2016-02-28_16-55-26
xtrabackup: This target seems to be already prepared.
xtrabackup: notice: xtrabackup_logfile was already used to '--prepare'.
xtrabackup: Temporary instance for recovery is set as followings.
xtrabackup:   innodb_data_home_dir = ./
xtrabackup:   innodb_data_file_path = ibdata1:10M:autoextend
xtrabackup:   innodb_log_group_home_dir = ./
xtrabackup:   innodb_log_files_in_group = 2
xtrabackup:   innodb_log_file_size = 5242880
160228 17:42:59 InnoDB: Using Linux native AIO
xtrabackup: Starting InnoDB instance for recovery.
xtrabackup: Using 104857600 bytes for buffer pool (set by --use-memory parameter)
160228 17:42:59 InnoDB: The InnoDB memory heap is disabled
160228 17:42:59 InnoDB: Mutexes and rw_locks use GCC atomic builtins
160228 17:42:59 InnoDB: Compressed tables use zlib 1.2.3
160228 17:42:59 InnoDB: Using Linux native AIO
160228 17:42:59 InnoDB: Warning: innodb_file_io_threads is deprecated. Please use innodb_read_io_threads and innodb_write_io_threads instead
160228 17:42:59 InnoDB: Initializing buffer pool, size = 100.0M
160228 17:42:59 InnoDB: Completed initialization of buffer pool
160228 17:42:59 InnoDB: highest supported file format is Barracuda.

[notice (again)]
  If you use binary log and don't use any hack of group commit,
  the binary log position seems to be:
InnoDB: Last MySQL binlog file position 0 577, file name ./mysql-bin.000001

xtrabackup: starting shutdown with innodb_fast_shutdown = 1
160228 17:42:59  InnoDB: Starting shutdown...
160228 17:43:00  InnoDB: Shutdown completed; log sequence number 1648652
160228 17:43:00  innobackupex: completed OK!

提示:等会还原的时候只需要还原完全备份就可以了,因为此时所有的提交操作,所有的redo操作都已经合并到完全备份上去了,还原的时候两个增量备份就用不上了;

[root@localhost ~]# service mysqld stop(停止mysqld服务)
Shutting down MySQL.                                       [  OK  ]
[root@localhost ~]# cd /mydata/data/(切换到/mydata/data目录)
[root@localhost data]# rm -rf ./*(删除当前目录所有文件,-r递归删除,-f强制删除)
[root@localhost data]# innobackupex --copy-back /backup/2016-02-28_16-55-26/(恢复数据)

InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy
and Percona Inc 2009-2012.  All Rights Reserved.

This software is published under
the GNU GENERAL PUBLIC LICENSE Version 2, June 1991.

IMPORTANT: Please check that the copy-back run completes successfully.
           At the end of a successful copy-back run innobackupex
           prints "completed OK!".

innobackupex: Starting to copy files in '/backup/2016-02-28_16-55-26'
innobackupex: back to original data directory '/mydata/data'
innobackupex: Copying file '/mydata/data/ib_logfile1'
innobackupex: Copying file '/mydata/data/ib_logfile0'
innobackupex: Copying file '/mydata/data/xtrabackup_checkpoints'
innobackupex: Copying file '/mydata/data/xtrabackup_binlog_pos_innodb'
innobackupex: Creating directory '/mydata/data/jiaowu'
innobackupex: Copying file '/mydata/data/students.ibd'
innobackupex: Copying file '/mydata/data/scores.frm'
innobackupex: Copying file '/mydata/data/courses.frm'
innobackupex: Copying file '/mydata/data/courses.ibd'
innobackupex: Copying file '/mydata/data/students.frm'
innobackupex: Copying file '/mydata/data/tutors.ibd'
innobackupex: Copying file '/mydata/data/scores.ibd'
innobackupex: Copying file '/mydata/data/tutors.frm'
innobackupex: Copying file '/mydata/data/db.opt'
innobackupex: Creating directory '/mydata/data/test'
innobackupex: Creating directory '/mydata/data/performance_schema'
innobackupex: Copying file '/mydata/data/file_instances.frm'
innobackupex: Copying file '/mydata/data/rwlock_instances.frm'
innobackupex: Copying file '/mydata/data/file_summary_by_instance.frm'
innobackupex: Copying file '/mydata/data/performance_timers.frm'
innobackupex: Copying file '/mydata/data/events_waits_summary_global_by_event_name.frm'
innobackupex: Copying file '/mydata/data/events_waits_summary_by_instance.frm'
innobackupex: Copying file '/mydata/data/setup_instruments.frm'
innobackupex: Copying file '/mydata/data/mutex_instances.frm'
innobackupex: Copying file '/mydata/data/cond_instances.frm'
innobackupex: Copying file '/mydata/data/threads.frm'
innobackupex: Copying file '/mydata/data/events_waits_history.frm'
innobackupex: Copying file '/mydata/data/setup_timers.frm'
innobackupex: Copying file '/mydata/data/events_waits_history_long.frm'
innobackupex: Copying file '/mydata/data/events_waits_summary_by_thread_by_event_name.frm'
innobackupex: Copying file '/mydata/data/setup_consumers.frm'
innobackupex: Copying file '/mydata/data/file_summary_by_event_name.frm'
innobackupex: Copying file '/mydata/data/events_waits_current.frm'
innobackupex: Copying file '/mydata/data/db.opt'
innobackupex: Creating directory '/mydata/data/mysql'
innobackupex: Copying file '/mydata/data/time_zone_name.frm'
innobackupex: Copying file '/mydata/data/time_zone.MYI'
innobackupex: Copying file '/mydata/data/plugin.MYI'
innobackupex: Copying file '/mydata/data/time_zone_name.MYI'
innobackupex: Copying file '/mydata/data/proc.MYD'
innobackupex: Copying file '/mydata/data/servers.MYD'
innobackupex: Copying file '/mydata/data/time_zone_name.MYD'
innobackupex: Copying file '/mydata/data/plugin.frm'
innobackupex: Copying file '/mydata/data/proxies_priv.frm'
innobackupex: Copying file '/mydata/data/proxies_priv.MYI'
innobackupex: Copying file '/mydata/data/columns_priv.MYD'
innobackupex: Copying file '/mydata/data/time_zone_leap_second.frm'
innobackupex: Copying file '/mydata/data/time_zone_leap_second.MYD'
innobackupex: Copying file '/mydata/data/help_keyword.frm'
innobackupex: Copying file '/mydata/data/host.frm'
innobackupex: Copying file '/mydata/data/user.frm'
innobackupex: Copying file '/mydata/data/func.MYD'
innobackupex: Copying file '/mydata/data/tables_priv.MYI'
innobackupex: Copying file '/mydata/data/ndb_binlog_index.frm'
innobackupex: Copying file '/mydata/data/slow_log.CSV'
innobackupex: Copying file '/mydata/data/proxies_priv.MYD'
innobackupex: Copying file '/mydata/data/ndb_binlog_index.MYI'
innobackupex: Copying file '/mydata/data/db.MYD'
innobackupex: Copying file '/mydata/data/columns_priv.MYI'
innobackupex: Copying file '/mydata/data/ndb_binlog_index.MYD'
innobackupex: Copying file '/mydata/data/procs_priv.MYD'
innobackupex: Copying file '/mydata/data/time_zone_transition_type.frm'
innobackupex: Copying file '/mydata/data/user.MYD'
innobackupex: Copying file '/mydata/data/plugin.MYD'
innobackupex: Copying file '/mydata/data/time_zone_transition_type.MYI'
innobackupex: Copying file '/mydata/data/event.frm'
innobackupex: Copying file '/mydata/data/help_relation.MYI'
innobackupex: Copying file '/mydata/data/help_category.MYD'
innobackupex: Copying file '/mydata/data/columns_priv.frm'
innobackupex: Copying file '/mydata/data/procs_priv.MYI'
innobackupex: Copying file '/mydata/data/func.MYI'
innobackupex: Copying file '/mydata/data/help_category.MYI'
innobackupex: Copying file '/mydata/data/general_log.CSM'
innobackupex: Copying file '/mydata/data/help_topic.MYI'
innobackupex: Copying file '/mydata/data/help_relation.MYD'
innobackupex: Copying file '/mydata/data/proc.frm'
innobackupex: Copying file '/mydata/data/db.MYI'
innobackupex: Copying file '/mydata/data/help_topic.MYD'
innobackupex: Copying file '/mydata/data/event.MYD'
innobackupex: Copying file '/mydata/data/time_zone_transition.MYD'
innobackupex: Copying file '/mydata/data/general_log.frm'
innobackupex: Copying file '/mydata/data/slow_log.frm'
innobackupex: Copying file '/mydata/data/event.MYI'
innobackupex: Copying file '/mydata/data/slow_log.CSM'
innobackupex: Copying file '/mydata/data/user.MYI'
innobackupex: Copying file '/mydata/data/tables_priv.MYD'
innobackupex: Copying file '/mydata/data/time_zone_leap_second.MYI'
innobackupex: Copying file '/mydata/data/func.frm'
innobackupex: Copying file '/mydata/data/time_zone.frm'
innobackupex: Copying file '/mydata/data/time_zone_transition.MYI'
innobackupex: Copying file '/mydata/data/proc.MYI'
innobackupex: Copying file '/mydata/data/tables_priv.frm'
innobackupex: Copying file '/mydata/data/procs_priv.frm'
innobackupex: Copying file '/mydata/data/host.MYI'
innobackupex: Copying file '/mydata/data/time_zone_transition_type.MYD'
innobackupex: Copying file '/mydata/data/time_zone.MYD'
innobackupex: Copying file '/mydata/data/host.MYD'
innobackupex: Copying file '/mydata/data/servers.frm'
innobackupex: Copying file '/mydata/data/help_keyword.MYI'
innobackupex: Copying file '/mydata/data/help_relation.frm'
innobackupex: Copying file '/mydata/data/help_topic.frm'
innobackupex: Copying file '/mydata/data/help_keyword.MYD'
innobackupex: Copying file '/mydata/data/time_zone_transition.frm'
innobackupex: Copying file '/mydata/data/db.frm'
innobackupex: Copying file '/mydata/data/general_log.CSV'
innobackupex: Copying file '/mydata/data/servers.MYI'
innobackupex: Copying file '/mydata/data/help_category.frm'
innobackupex: Creating directory '/mydata/data/mydb'
innobackupex: Copying file '/mydata/data/db.opt'

innobackupex: Starting to copy InnoDB system tablespace
innobackupex: in '/backup/2016-02-28_16-55-26'
innobackupex: back to original InnoDB data directory '/mydata/data'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/ibdata1'

innobackupex: Starting to copy InnoDB log files
innobackupex: in '/backup/2016-02-28_16-55-26'
innobackupex: back to original InnoDB log directory '/mydata/data'
innobackupex: Finished copying back files.

160228 17:48:54  innobackupex: completed OK!

[root@localhost data]# chown -R mysql.mysql ./*(修改当前目录所有文件属主属组为mysql)          
[root@localhost data]# ll(查看当前目录文件及子目录详细信息)
total 28788
-rw-r----- 1 mysql mysql 18874368 Feb 28 17:42 ibdata1
-rw-r--r-- 1 mysql mysql  5242880 Feb 28 17:48 ib_logfile0
-rw-r--r-- 1 mysql mysql  5242880 Feb 28 17:48 ib_logfile1
drwxr-xr-x 2 mysql mysql     4096 Feb 28 17:48 jiaowu
drwxr-xr-x 2 mysql mysql     4096 Feb 28 17:48 mydb
drwxr-xr-x 2 mysql mysql     4096 Feb 28 17:48 mysql
drwxr-xr-x 2 mysql mysql     4096 Feb 28 17:48 performance_schema
drwxr-xr-x 2 mysql mysql     4096 Feb 28 17:48 test
-rw-r--r-- 1 mysql mysql       23 Feb 28 17:48 xtrabackup_binlog_pos_innodb
-rw-r--r-- 1 mysql mysql       77 Feb 28 17:48 xtrabackup_checkpoints
[root@localhost data]# cat xtrabackup_checkpoints(查看xtrabackup_checkpoints文件内容)
backup_type = full-prepared
from_lsn = 0
to_lsn = 1648427
last_lsn = 1648427
[root@localhost data]# service mysqld start(启动mysqld服务)
Starting MySQL..                                           [  OK  ]
[root@localhost data]# mysql(连接mysql)
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.5.28-log Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> USE jiaowu;(修改默认数据库为jiaowu)
Database changed

mysql> SELECT * FROM tutors;(查看tutors表所有字段数据)
+-----+--------------+--------+------+
| TID | Tname        | Gender | Age  |
+-----+--------------+--------+------+
|   1 | HongQigong   | M      |   93 | 
|   2 | HuangYaoshi  | M      |   63 | 
|   3 | Miejueshitai | F      |   72 | 
|   4 | OuYangfeng   | M      |   76 | 
|   5 | YiDeng       | M      |   90 | 
|   6 | YuCanghai    | M      |   56 | 
|   7 | Jinlunfawang | M      |   67 | 
|   8 | HuYidao      | M      |   42 | 
|   9 | NingZhongze  | F      |   49 | 
|  10 | stu001       | M      | NULL | 
|  11 | stu002       | M      | NULL | 
|  12 | stu003       | M      | NULL | 
|  13 | stu004       | M      | NULL | 
|  14 | stu0005      | M      | NULL | 
|  15 | stu0006      | M      | NULL | 
|  16 | stu0007      | M      | NULL | 
|  17 | stu0008      | M      | NULL | 
+-----+--------------+--------+------+
17 rows in set (0.00 sec)

mysql> \q(退出)
Bye

提示:没有恢复到当前数据;

[root@localhost data]# cd(切换到用户家目录)
[root@localhost ~]# innobackupex --apply-log --redo-only /backup/2016-02-28_16-55-26/ --incremental-dir=/backup/2016-02-28_17-01-50/(装备
第一次增量备份,--incremental-dir第一次增量备份目录)

InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy
and Percona Inc 2009-2012.  All Rights Reserved.

This software is published under
the GNU GENERAL PUBLIC LICENSE Version 2, June 1991.

IMPORTANT: Please check that the apply-log run completes successfully.
           At the end of a successful apply-log run innobackupex
           prints "completed OK!".



160228 17:54:54  innobackupex: Starting ibbackup with command: xtrabackup_55 --prepare --target-dir=/backup/2016-02-28_16-55-26 --apply-
log-only --incremental-dir=/backup/2016-02-28_17-01-50/

xtrabackup_55 version 2.0.0 for Percona Server 5.5.16 Linux (i686) (revision id: 417)
incremental backup from 1648427 is enabled.
xtrabackup: cd to /backup/2016-02-28_16-55-26
xtrabackup: This target seems to be already prepared.
xtrabackup: xtrabackup_logfile detected: size=2097152, start_lsn=(1648997)
xtrabackup: page size for /backup/2016-02-28_17-01-50//ibdata1.delta is 16384 bytes
Applying /backup/2016-02-28_17-01-50//ibdata1.delta ...
xtrabackup: page size for /backup/2016-02-28_17-01-50//jiaowu/courses.ibd.delta is 16384 bytes
Applying /backup/2016-02-28_17-01-50//jiaowu/courses.ibd.delta ...
xtrabackup: page size for /backup/2016-02-28_17-01-50//jiaowu/scores.ibd.delta is 16384 bytes
Applying /backup/2016-02-28_17-01-50//jiaowu/scores.ibd.delta ...
xtrabackup: page size for /backup/2016-02-28_17-01-50//jiaowu/students.ibd.delta is 16384 bytes
Applying /backup/2016-02-28_17-01-50//jiaowu/students.ibd.delta ...
xtrabackup: page size for /backup/2016-02-28_17-01-50//jiaowu/tutors.ibd.delta is 16384 bytes
Applying /backup/2016-02-28_17-01-50//jiaowu/tutors.ibd.delta ...
xtrabackup: Temporary instance for recovery is set as followings.
xtrabackup:   innodb_data_home_dir = ./
xtrabackup:   innodb_data_file_path = ibdata1:10M:autoextend
xtrabackup:   innodb_log_group_home_dir = /backup/2016-02-28_17-01-50/
xtrabackup:   innodb_log_files_in_group = 1
xtrabackup:   innodb_log_file_size = 2097152
160228 17:54:54 InnoDB: Using Linux native AIO
xtrabackup: Starting InnoDB instance for recovery.
xtrabackup: Using 104857600 bytes for buffer pool (set by --use-memory parameter)
160228 17:54:54 InnoDB: The InnoDB memory heap is disabled
160228 17:54:54 InnoDB: Mutexes and rw_locks use GCC atomic builtins
160228 17:54:54 InnoDB: Compressed tables use zlib 1.2.3
160228 17:54:54 InnoDB: Using Linux native AIO
160228 17:54:54 InnoDB: Warning: innodb_file_io_threads is deprecated. Please use innodb_read_io_threads and innodb_write_io_threads instead
160228 17:54:54 InnoDB: Initializing buffer pool, size = 100.0M
160228 17:54:54 InnoDB: Completed initialization of buffer pool
160228 17:54:54 InnoDB: highest supported file format is Barracuda.
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
160228 17:54:54  InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Last MySQL binlog file position 0 1047, file name ./mysql-bin.000001

[notice (again)]
  If you use binary log and don't use any hack of group commit,
  the binary log position seems to be:
InnoDB: Last MySQL binlog file position 0 1047, file name ./mysql-bin.000001

xtrabackup: starting shutdown with innodb_fast_shutdown = 1
160228 17:54:54  InnoDB: Starting shutdown...
160228 17:54:55  InnoDB: Shutdown completed; log sequence number 1648997
innobackupex: Starting to copy non-InnoDB files in '/backup/2016-02-28_17-01-50/'
innobackupex: to the full backup directory '/backup/2016-02-28_16-55-26'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/xtrabackup_binlog_info'
innobackupex: Creating directory '/backup/2016-02-28_16-55-26jiaowu'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/scores.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/courses.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/students.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/tutors.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/db.opt'
innobackupex: Creating directory '/backup/2016-02-28_16-55-26test'
innobackupex: Creating directory '/backup/2016-02-28_16-55-26performance_schema'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/file_instances.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/rwlock_instances.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/file_summary_by_instance.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/performance_timers.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/events_waits_summary_global_by_event_name.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/events_waits_summary_by_instance.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/setup_instruments.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/mutex_instances.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/cond_instances.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/threads.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/events_waits_history.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/setup_timers.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/events_waits_history_long.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/events_waits_summary_by_thread_by_event_name.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/setup_consumers.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/file_summary_by_event_name.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/events_waits_current.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/db.opt'
innobackupex: Creating directory '/backup/2016-02-28_16-55-26mysql'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/time_zone_name.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/time_zone.MYI'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/plugin.MYI'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/time_zone_name.MYI'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/proc.MYD'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/servers.MYD'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/time_zone_name.MYD'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/plugin.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/proxies_priv.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/proxies_priv.MYI'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/columns_priv.MYD'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/time_zone_leap_second.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/time_zone_leap_second.MYD'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/help_keyword.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/host.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/user.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/func.MYD'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/tables_priv.MYI'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/ndb_binlog_index.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/slow_log.CSV'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/proxies_priv.MYD'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/ndb_binlog_index.MYI'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/db.MYD'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/columns_priv.MYI'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/ndb_binlog_index.MYD'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/procs_priv.MYD'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/time_zone_transition_type.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/user.MYD'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/plugin.MYD'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/time_zone_transition_type.MYI'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/event.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/help_relation.MYI'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/help_category.MYD'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/columns_priv.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/procs_priv.MYI'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/func.MYI'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/help_category.MYI'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/general_log.CSM'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/help_topic.MYI'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/help_relation.MYD'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/proc.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/db.MYI'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/help_topic.MYD'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/event.MYD'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/time_zone_transition.MYD'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/general_log.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/slow_log.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/event.MYI'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/slow_log.CSM'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/user.MYI'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/tables_priv.MYD'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/time_zone_leap_second.MYI'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/func.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/time_zone.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/time_zone_transition.MYI'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/proc.MYI'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/tables_priv.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/procs_priv.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/host.MYI'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/time_zone_transition_type.MYD'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/time_zone.MYD'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/host.MYD'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/servers.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/help_keyword.MYI'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/help_relation.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/help_topic.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/help_keyword.MYD'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/time_zone_transition.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/db.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/general_log.CSV'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/servers.MYI'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/help_category.frm'
innobackupex: Creating directory '/backup/2016-02-28_16-55-26mydb'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/db.opt'
160228 17:54:55  innobackupex: completed OK!

[root@localhost ~]# innobackupex --apply-log --redo-only /backup/2016-02-28_16-55-26/ --incremental-dir=/backup/2016-02-28_17-09-24/(装备第
二次增量备份,--incremental-dir第二次增量备份目录)

InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy
and Percona Inc 2009-2012.  All Rights Reserved.

This software is published under
the GNU GENERAL PUBLIC LICENSE Version 2, June 1991.

IMPORTANT: Please check that the apply-log run completes successfully.
           At the end of a successful apply-log run innobackupex
           prints "completed OK!".



160228 17:56:07  innobackupex: Starting ibbackup with command: xtrabackup_55 --prepare --target-dir=/backup/2016-02-28_16-55-26 --apply-log
-only --incremental-dir=/backup/2016-02-28_17-09-24/

xtrabackup_55 version 2.0.0 for Percona Server 5.5.16 Linux (i686) (revision id: 417)
incremental backup from 1648997 is enabled.
xtrabackup: cd to /backup/2016-02-28_16-55-26
xtrabackup: This target seems to be already prepared.
xtrabackup: xtrabackup_logfile detected: size=2097152, start_lsn=(1650315)
xtrabackup: page size for /backup/2016-02-28_17-09-24//ibdata1.delta is 16384 bytes
Applying /backup/2016-02-28_17-09-24//ibdata1.delta ...
xtrabackup: page size for /backup/2016-02-28_17-09-24//jiaowu/courses.ibd.delta is 16384 bytes
Applying /backup/2016-02-28_17-09-24//jiaowu/courses.ibd.delta ...
xtrabackup: page size for /backup/2016-02-28_17-09-24//jiaowu/scores.ibd.delta is 16384 bytes
Applying /backup/2016-02-28_17-09-24//jiaowu/scores.ibd.delta ...
xtrabackup: page size for /backup/2016-02-28_17-09-24//jiaowu/students.ibd.delta is 16384 bytes
Applying /backup/2016-02-28_17-09-24//jiaowu/students.ibd.delta ...
xtrabackup: page size for /backup/2016-02-28_17-09-24//jiaowu/tutors.ibd.delta is 16384 bytes
Applying /backup/2016-02-28_17-09-24//jiaowu/tutors.ibd.delta ...
xtrabackup: Temporary instance for recovery is set as followings.
xtrabackup:   innodb_data_home_dir = ./
xtrabackup:   innodb_data_file_path = ibdata1:10M:autoextend
xtrabackup:   innodb_log_group_home_dir = /backup/2016-02-28_17-09-24/
xtrabackup:   innodb_log_files_in_group = 1
xtrabackup:   innodb_log_file_size = 2097152
160228 17:56:08 InnoDB: Using Linux native AIO
xtrabackup: Starting InnoDB instance for recovery.
xtrabackup: Using 104857600 bytes for buffer pool (set by --use-memory parameter)
160228 17:56:08 InnoDB: The InnoDB memory heap is disabled
160228 17:56:08 InnoDB: Mutexes and rw_locks use GCC atomic builtins
160228 17:56:08 InnoDB: Compressed tables use zlib 1.2.3
160228 17:56:08 InnoDB: Using Linux native AIO
160228 17:56:08 InnoDB: Warning: innodb_file_io_threads is deprecated. Please use innodb_read_io_threads and innodb_write_io_threads instead
160228 17:56:08 InnoDB: Initializing buffer pool, size = 100.0M
160228 17:56:08 InnoDB: Completed initialization of buffer pool
160228 17:56:08 InnoDB: highest supported file format is Barracuda.
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
160228 17:56:08  InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Last MySQL binlog file position 0 1517, file name ./mysql-bin.000001

[notice (again)]
  If you use binary log and don't use any hack of group commit,
  the binary log position seems to be:
InnoDB: Last MySQL binlog file position 0 1517, file name ./mysql-bin.000001

xtrabackup: starting shutdown with innodb_fast_shutdown = 1
160228 17:56:08  InnoDB: Starting shutdown...
160228 17:56:09  InnoDB: Shutdown completed; log sequence number 1650315
innobackupex: Starting to copy non-InnoDB files in '/backup/2016-02-28_17-09-24/'
innobackupex: to the full backup directory '/backup/2016-02-28_16-55-26'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/xtrabackup_binlog_info'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/scores.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/courses.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/students.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/tutors.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/db.opt'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/file_instances.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/rwlock_instances.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/file_summary_by_instance.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/performance_timers.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/events_waits_summary_global_by_event_name.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/events_waits_summary_by_instance.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/setup_instruments.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/mutex_instances.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/cond_instances.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/threads.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/events_waits_history.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/setup_timers.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/events_waits_history_long.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/events_waits_summary_by_thread_by_event_name.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/setup_consumers.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/file_summary_by_event_name.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/events_waits_current.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/db.opt'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/time_zone_name.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/time_zone.MYI'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/plugin.MYI'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/time_zone_name.MYI'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/proc.MYD'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/servers.MYD'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/time_zone_name.MYD'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/plugin.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/proxies_priv.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/proxies_priv.MYI'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/columns_priv.MYD'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/time_zone_leap_second.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/time_zone_leap_second.MYD'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/help_keyword.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/host.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/user.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/func.MYD'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/tables_priv.MYI'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/ndb_binlog_index.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/slow_log.CSV'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/proxies_priv.MYD'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/ndb_binlog_index.MYI'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/db.MYD'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/columns_priv.MYI'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/ndb_binlog_index.MYD'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/procs_priv.MYD'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/time_zone_transition_type.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/user.MYD'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/plugin.MYD'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/time_zone_transition_type.MYI'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/event.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/help_relation.MYI'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/help_category.MYD'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/columns_priv.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/procs_priv.MYI'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/func.MYI'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/help_category.MYI'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/general_log.CSM'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/help_topic.MYI'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/help_relation.MYD'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/proc.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/db.MYI'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/help_topic.MYD'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/event.MYD'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/time_zone_transition.MYD'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/general_log.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/slow_log.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/event.MYI'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/slow_log.CSM'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/user.MYI'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/tables_priv.MYD'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/time_zone_leap_second.MYI'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/func.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/time_zone.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/time_zone_transition.MYI'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/proc.MYI'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/tables_priv.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/procs_priv.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/host.MYI'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/time_zone_transition_type.MYD'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/time_zone.MYD'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/host.MYD'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/servers.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/help_keyword.MYI'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/help_relation.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/help_topic.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/help_keyword.MYD'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/time_zone_transition.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/db.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/general_log.CSV'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/servers.MYI'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/help_category.frm'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/db.opt'
160228 17:56:09  innobackupex: completed OK!
[root@localhost ~]# service mysqld stop(停止mysqld服务)
Shutting down MySQL.                                       [  OK  ]
[root@localhost ~]# cd /mydata/data/(切换到/mydata/data目录)
[root@localhost data]# rm -rf ./*(删除当前目录下所有文件,-r递归删除,-f强制删除)
[root@localhost data]# ls(删除当前目录文件及子目录)
[root@localhost data]# ls /backup/(查看/backup目录文件及子目录)
2016-02-28_15-22-13        2016-02-28_16-55-26mydb                2016-02-28_16-55-26test                    2016-02-28_17-09-24
master2016-02-28.info      2016-02-28_16-55-26                    2016-02-28_16-55-26mysql                   2016-02-28_16-55-26xtrabackup
_binlog_info               full-backup-2016-02-28                 master.info                                2016-02-28_16-55-26jiaowu
2016-02-28_16-55-26performance_schema                             2016-02-28_17-01-50                        incremental-2016-02-28-13-43-01
.sql

[root@localhost data]# innobackupex --copy-back /backup/2016-02-28_16-55-26(恢复数据,--copy-back指向合并后的完全备份目录)

InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy
and Percona Inc 2009-2012.  All Rights Reserved.

This software is published under
the GNU GENERAL PUBLIC LICENSE Version 2, June 1991.

IMPORTANT: Please check that the copy-back run completes successfully.
           At the end of a successful copy-back run innobackupex
           prints "completed OK!".

innobackupex: Starting to copy files in '/backup/2016-02-28_16-55-26'
innobackupex: back to original data directory '/mydata/data'
innobackupex: Copying file '/mydata/data/ib_logfile1'
innobackupex: Copying file '/mydata/data/ib_logfile0'
innobackupex: Copying file '/mydata/data/xtrabackup_checkpoints'
innobackupex: Copying file '/mydata/data/xtrabackup_binlog_pos_innodb'
innobackupex: Creating directory '/mydata/data/jiaowu'
innobackupex: Copying file '/mydata/data/students.ibd'
innobackupex: Copying file '/mydata/data/scores.frm'
innobackupex: Copying file '/mydata/data/courses.frm'
innobackupex: Copying file '/mydata/data/courses.ibd'
innobackupex: Copying file '/mydata/data/students.frm'
innobackupex: Copying file '/mydata/data/tutors.ibd'
innobackupex: Copying file '/mydata/data/scores.ibd'
innobackupex: Copying file '/mydata/data/tutors.frm'
innobackupex: Copying file '/mydata/data/db.opt'
innobackupex: Creating directory '/mydata/data/test'
innobackupex: Creating directory '/mydata/data/performance_schema'
innobackupex: Copying file '/mydata/data/file_instances.frm'
innobackupex: Copying file '/mydata/data/rwlock_instances.frm'
innobackupex: Copying file '/mydata/data/file_summary_by_instance.frm'
innobackupex: Copying file '/mydata/data/performance_timers.frm'
innobackupex: Copying file '/mydata/data/events_waits_summary_global_by_event_name.frm'
innobackupex: Copying file '/mydata/data/events_waits_summary_by_instance.frm'
innobackupex: Copying file '/mydata/data/setup_instruments.frm'
innobackupex: Copying file '/mydata/data/mutex_instances.frm'
innobackupex: Copying file '/mydata/data/cond_instances.frm'
innobackupex: Copying file '/mydata/data/threads.frm'
innobackupex: Copying file '/mydata/data/events_waits_history.frm'
innobackupex: Copying file '/mydata/data/setup_timers.frm'
innobackupex: Copying file '/mydata/data/events_waits_history_long.frm'
innobackupex: Copying file '/mydata/data/events_waits_summary_by_thread_by_event_name.frm'
innobackupex: Copying file '/mydata/data/setup_consumers.frm'
innobackupex: Copying file '/mydata/data/file_summary_by_event_name.frm'
innobackupex: Copying file '/mydata/data/events_waits_current.frm'
innobackupex: Copying file '/mydata/data/db.opt'
innobackupex: Creating directory '/mydata/data/mysql'
innobackupex: Copying file '/mydata/data/time_zone_name.frm'
innobackupex: Copying file '/mydata/data/time_zone.MYI'
innobackupex: Copying file '/mydata/data/plugin.MYI'
innobackupex: Copying file '/mydata/data/time_zone_name.MYI'
innobackupex: Copying file '/mydata/data/proc.MYD'
innobackupex: Copying file '/mydata/data/servers.MYD'
innobackupex: Copying file '/mydata/data/time_zone_name.MYD'
innobackupex: Copying file '/mydata/data/plugin.frm'
innobackupex: Copying file '/mydata/data/proxies_priv.frm'
innobackupex: Copying file '/mydata/data/proxies_priv.MYI'
innobackupex: Copying file '/mydata/data/columns_priv.MYD'
innobackupex: Copying file '/mydata/data/time_zone_leap_second.frm'
innobackupex: Copying file '/mydata/data/time_zone_leap_second.MYD'
innobackupex: Copying file '/mydata/data/help_keyword.frm'
innobackupex: Copying file '/mydata/data/host.frm'
innobackupex: Copying file '/mydata/data/user.frm'
innobackupex: Copying file '/mydata/data/func.MYD'
innobackupex: Copying file '/mydata/data/tables_priv.MYI'
innobackupex: Copying file '/mydata/data/ndb_binlog_index.frm'
innobackupex: Copying file '/mydata/data/slow_log.CSV'
innobackupex: Copying file '/mydata/data/proxies_priv.MYD'
innobackupex: Copying file '/mydata/data/ndb_binlog_index.MYI'
innobackupex: Copying file '/mydata/data/db.MYD'
innobackupex: Copying file '/mydata/data/columns_priv.MYI'
innobackupex: Copying file '/mydata/data/ndb_binlog_index.MYD'
innobackupex: Copying file '/mydata/data/procs_priv.MYD'
innobackupex: Copying file '/mydata/data/time_zone_transition_type.frm'
innobackupex: Copying file '/mydata/data/user.MYD'
innobackupex: Copying file '/mydata/data/plugin.MYD'
innobackupex: Copying file '/mydata/data/time_zone_transition_type.MYI'
innobackupex: Copying file '/mydata/data/event.frm'
innobackupex: Copying file '/mydata/data/help_relation.MYI'
innobackupex: Copying file '/mydata/data/help_category.MYD'
innobackupex: Copying file '/mydata/data/columns_priv.frm'
innobackupex: Copying file '/mydata/data/procs_priv.MYI'
innobackupex: Copying file '/mydata/data/func.MYI'
innobackupex: Copying file '/mydata/data/help_category.MYI'
innobackupex: Copying file '/mydata/data/general_log.CSM'
innobackupex: Copying file '/mydata/data/help_topic.MYI'
innobackupex: Copying file '/mydata/data/help_relation.MYD'
innobackupex: Copying file '/mydata/data/proc.frm'
innobackupex: Copying file '/mydata/data/db.MYI'
innobackupex: Copying file '/mydata/data/help_topic.MYD'
innobackupex: Copying file '/mydata/data/event.MYD'
innobackupex: Copying file '/mydata/data/time_zone_transition.MYD'
innobackupex: Copying file '/mydata/data/general_log.frm'
innobackupex: Copying file '/mydata/data/slow_log.frm'
innobackupex: Copying file '/mydata/data/event.MYI'
innobackupex: Copying file '/mydata/data/slow_log.CSM'
innobackupex: Copying file '/mydata/data/user.MYI'
innobackupex: Copying file '/mydata/data/tables_priv.MYD'
innobackupex: Copying file '/mydata/data/time_zone_leap_second.MYI'
innobackupex: Copying file '/mydata/data/func.frm'
innobackupex: Copying file '/mydata/data/time_zone.frm'
innobackupex: Copying file '/mydata/data/time_zone_transition.MYI'
innobackupex: Copying file '/mydata/data/proc.MYI'
innobackupex: Copying file '/mydata/data/tables_priv.frm'
innobackupex: Copying file '/mydata/data/procs_priv.frm'
innobackupex: Copying file '/mydata/data/host.MYI'
innobackupex: Copying file '/mydata/data/time_zone_transition_type.MYD'
innobackupex: Copying file '/mydata/data/time_zone.MYD'
innobackupex: Copying file '/mydata/data/host.MYD'
innobackupex: Copying file '/mydata/data/servers.frm'
innobackupex: Copying file '/mydata/data/help_keyword.MYI'
innobackupex: Copying file '/mydata/data/help_relation.frm'
innobackupex: Copying file '/mydata/data/help_topic.frm'
innobackupex: Copying file '/mydata/data/help_keyword.MYD'
innobackupex: Copying file '/mydata/data/time_zone_transition.frm'
innobackupex: Copying file '/mydata/data/db.frm'
innobackupex: Copying file '/mydata/data/general_log.CSV'
innobackupex: Copying file '/mydata/data/servers.MYI'
innobackupex: Copying file '/mydata/data/help_category.frm'
innobackupex: Creating directory '/mydata/data/mydb'
innobackupex: Copying file '/mydata/data/db.opt'

innobackupex: Starting to copy InnoDB system tablespace
innobackupex: in '/backup/2016-02-28_16-55-26'
innobackupex: back to original InnoDB data directory '/mydata/data'
innobackupex: Copying file '/backup/2016-02-28_16-55-26/ibdata1'

innobackupex: Starting to copy InnoDB log files
innobackupex: in '/backup/2016-02-28_16-55-26'
innobackupex: back to original InnoDB log directory '/mydata/data'
innobackupex: Finished copying back files.

160228 18:02:00  innobackupex: completed OK!

[root@localhost data]# ll(查看当前目录文件及子目录详细信息)
total 28788
-rw-r----- 1 root root 18874368 Feb 28 17:56 ibdata1
-rw-r--r-- 1 root root  5242880 Feb 28 18:01 ib_logfile0
-rw-r--r-- 1 root root  5242880 Feb 28 18:01 ib_logfile1
drwxr-xr-x 2 root root     4096 Feb 28 18:01 jiaowu
drwxr-xr-x 2 root root     4096 Feb 28 18:02 mydb
drwxr-xr-x 2 root root     4096 Feb 28 18:02 mysql
drwxr-xr-x 2 root root     4096 Feb 28 18:01 performance_schema
drwxr-xr-x 2 root root     4096 Feb 28 18:01 test
-rw-r--r-- 1 root root       24 Feb 28 18:01 xtrabackup_binlog_pos_innodb
-rw-r--r-- 1 root root       77 Feb 28 18:01 xtrabackup_checkpoints
[root@localhost data]# cat xtrabackup_checkpoints(查看xtrabackup_checkpoints文件内容)
backup_type = full-prepared
from_lsn = 0
to_lsn = 1650315
last_lsn = 1650315
[root@localhost data]# chown -R mysql.mysql ./*(更改当前目录所有文件属主数组为mysql)
[root@localhost data]# ll(查看当前目录文件详细信息)
total 28788
-rw-r----- 1 mysql mysql 18874368 Feb 28 17:56 ibdata1
-rw-r--r-- 1 mysql mysql  5242880 Feb 28 18:01 ib_logfile0
-rw-r--r-- 1 mysql mysql  5242880 Feb 28 18:01 ib_logfile1
drwxr-xr-x 2 mysql mysql     4096 Feb 28 18:01 jiaowu
drwxr-xr-x 2 mysql mysql     4096 Feb 28 18:02 mydb
drwxr-xr-x 2 mysql mysql     4096 Feb 28 18:02 mysql
drwxr-xr-x 2 mysql mysql     4096 Feb 28 18:01 performance_schema
drwxr-xr-x 2 mysql mysql     4096 Feb 28 18:01 test
-rw-r--r-- 1 mysql mysql       24 Feb 28 18:01 xtrabackup_binlog_pos_innodb
-rw-r--r-- 1 mysql mysql       77 Feb 28 18:01 xtrabackup_checkpoints
[root@localhost data]# service mysqld start(启动mysqld服务)
Starting MySQL..                                           [  OK  ]
[root@localhost data]# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.5.28-log Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> USE jiaowu(修改默认库为jiaowu)

mysql> SELECT * FROM tutors;(查看tutors表所有字段信息)
+-----+--------------+--------+------+
| TID | Tname        | Gender | Age  |
+-----+--------------+--------+------+
|   1 | HongQigong   | M      |   93 | 
|   2 | HuangYaoshi  | M      |   63 | 
|   3 | Miejueshitai | F      |   72 | 
|   4 | OuYangfeng   | M      |   76 | 
|   5 | YiDeng       | M      |   90 | 
|   6 | YuCanghai    | M      |   56 | 
|   7 | Jinlunfawang | M      |   67 | 
|   8 | HuYidao      | M      |   42 | 
|   9 | NingZhongze  | F      |   49 | 
|  10 | stu001       | M      | NULL | 
|  11 | stu002       | M      | NULL | 
|  12 | stu003       | M      | NULL | 
|  13 | stu004       | M      | NULL | 
|  14 | stu0005      | M      | NULL | 
|  15 | stu0006      | M      | NULL | 
|  16 | stu0007      | M      | NULL | 
|  17 | stu0008      | M      | NULL | 
|  18 | stu0009      | M      | NULL | 
|  19 | stu0010      | M      | NULL | 
|  20 | stu0011      | M      | NULL | 
|  21 | stu0012      | M      | NULL | 
+-----+--------------+--------+------+
21 rows in set (0.00 sec)

mysql> \q(退出)
Bye

[root@localhost data]# ls /backup/(查看/backup目录文件及子目录)
2016-02-28_15-22-13        2016-02-28_16-55-26mydb                2016-02-28_16-55-26test                    2016-02-28_17-09-24
master2016-02-28.info      2016-02-28_16-55-26                    2016-02-28_16-55-26mysql                   2016-02-28_16-55-26xtrabackup
_binlog_info               full-backup-2016-02-28                 master.info                                2016-02-28_16-55-26jiaowu
2016-02-28_16-55-26performance_schema                             2016-02-28_17-01-50                        incremental-2016-02-28-13-43-01
.sql