Home > Database > Mysql Tutorial > body text

mysql数据文件删除,操作系统级别恢复文件_MySQL

WBOY
Release: 2016-06-01 13:00:03
Original
1100 people have browsed it

在什么备份的情况下,数据文件被删除了恢复
一些限制条件

1.需要恢复的数据块不要被使用

2.不是文件系统本身发生了损坏
使用工具ext3grep,http://code.google.com/p/ext3grep/
安装
./configure
make
make install


mount
ls -id 数据文件存放的文件系统目录 --查看inode
umount 数据文件存放的文件系统目录
ext3grep /dev/sdb1 --ls --inode 2
ext3grep /dev/sdb1 --ls --inode 3
ext3grep /dev/sdb1 --ls --inode 4


ext3grep /dev/sdb1 --restore-inode 2 --到一个空目录下执行
mv ./RESTORED_FILES/inode.2 t3.MYI


ext3grep /dev/sdb1 --restore-inode 3
mv ./RESTORED_FILES/inode.3 t3.MYD


ext3grep /dev/sdb1 --restore-inode 4
mv ./RESTORED_FILES/inode.4 t3.frm


cp t3* /home/mysql/db1
chown mysql:mysql t3*






extundelete工具类似ext3grep 可以恢复ext4类型
extundelete /dev/sdb1 --inode 2
extundelete /dev/sdb1 --restore-inode 2
Related labels:
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!