Home > Database > Mysql Tutorial > body text

WIKI系统及MysQL数据库宕机恢复文档

WBOY
Release: 2016-06-07 17:37:52
Original
1093 people have browsed it

WIKI系统宕机恢复:由于WIKI系统为虚拟机环境,当出现问题时可直接使用镜像恢复。而且虚拟机环境故障率较低。Mysql数据库宕机恢复:mysql增量恢复必备条件:*开

WIKI

提示:如果有多个库,此时:


2)恢复凌晨全备

开始恢复,先回复凌晨全备,然后恢复整备到出问题时的所有增量数据。

解压全备文件

[root@lampbackup]# gzip -d mysql_backup_2013-06-16.sql.gz

开始恢复全备

[root@lampbackup]# mysql -uroot -p'oldboy' -S /data/3306/mysql.sock

[root@lampbackup]# mysql -uroot -p'oldboy' -S /data/3306/mysql.sock -e "showdatabases;"

+--------------------+

|Database |

+--------------------+

|information_schema |

|baozi |

|chengcai |

|haole |

|lalala |

|mysql |

|oldboy |

|test |

|xiaobao |

+--------------------+

[root@lampbackup]# mysql -uroot -p'oldboy' -S /data/3306/mysql.sock -e "set namesgbk;select * from oldboy.student;"

+-----+-----------+------+------+--------------------+

| Sno| Sname | Ssex | Sage | Sdept |

+-----+-----------+------+------+--------------------+

| 1 | ???? | ?? | 24 | ?????ú???? |

| 2 | elain | ?? | 26 | computer applica |

| 3 | xiaozhang | ?? | 28| ???÷???í |

| 4 | jeacen | ?? | 20 | computer applica |

| 5 | ???? | ?? | 29 | ?????ú???§?????? |

+-----+-----------+------+------+--------------------+

3)恢复增量备份

然后我们进行恢复全备和增量备份:

[root@lampbackup]# mysql -uroot -p'oldboy' -S /data/3306/mysql.sock

[root@lampbackup]# mysql -uroot -p'oldboy' -S /data/3306/mysql.sock

+-----+-----------+------+------+--------------------+

| Sno| Sname | Ssex | Sage | Sdept |

+-----+-----------+------+------+--------------------+

| 1 | ???? | ?? | 24 | ?????ú???? |

| 2 | elain | ?? | 26 | computer applica |

| 3 | xiaozhang | ?? | 28| ???÷???í |

| 4 | jeacen | ?? | 20 | computer applica |

| 5 | ???? | ?? | 29 | ?????ú???§?????? |

| 6 | xiaobao | ma | 29 | computer |

+-----+-----------+------+------+--------------------+


现在我们恢复到了0点到出现问题时刻的全备数据。

注意:恢复时应严格按照步骤进行,,提取最新的binlog日志。尽量减少数据的丢失。保证数据的完整。


本文出自 “袭浪” 博客,请务必保留此出处

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template