标签:备份目录 man sel mkdir 一个 master ignore sha 滚动
新建一个lvm磁盘,这里我建的lv为mydatalv,挂载到了/data下[root@localhost ~]# cp -a /myback/ /data/
[root@localhost ~]# service mariadb restart
利用二进制日志还原快照后的操作,由下面这个文件来查看快照执行时二进制日志的位置
[root@localhost ~]# cat back.2016-07-13+10\:14\:29
File Position Binlog_Do_DB Binlog_Ignore_DB
mysql-bin.000014 245
将000014中245之后的操作做成sql文件,进行还原
[root@localhost ~]# mysqlbinlog --start-position=245 /var/lib/mysql/mysql-bin.000014 > binlog.sql
[root@localhost ~]# mysql < /root/binlog.sql
查看恢复情况
[root@localhost ~]# mysql
MariaDB [(none)]> use hellodb;
MariaDB [hellodb]> select from classes;
+---------+----------------+----------+
| ClassID | Class | NumOfStu |
+---------+----------------+----------+
| 1 | Shaolin Pai | 10 |
| 2 | Emei Pai | 7 |
| 3 | QingCheng Pai | 11 |
| 4 | Wudang Pai | 12 |
| 5 | Riyue Shenjiao | 31 |
| 6 | Lianshan Pai | 27 |
| 7 | Ming Jiao | 27 |
| 8 | Xiaoyao Pai | 15 |
| 9 | xxoo | 39 |
+---------+----------------+----------+
9 rows in set (0.00 sec)
标签:备份目录 man sel mkdir 一个 master ignore sha 滚动
原文地址:http://blog.51cto.com/5165807/2326507