如何恢复MySQL数据库:文件"./xxx.frm"中的信息不正确 [英] How to recover a MySQL database: Incorrect information in file: './xxx.frm'

查看:95
本文介绍了如何恢复MySQL数据库:文件"./xxx.frm"中的信息不正确的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一个非常重要的数据库损坏了,该数据库位于共享Web主机上的服务器上,而我没有进行备份.该表包含非常重要的电子邮件地址的大量列表.我可以获得一个表列表,但是如果我使用Navicat或phpMyAdmin打开任何表,则会出现以下错误:

A very important database has gone corrupt that was sitting on server at a shared web host, and I didn't back up. The table contains a large list of very important email addresses. I can get a table listing, but if I open any of the tables with Navicat or phpMyAdmin, I get the following error:

文件中的错误信息:"./the-table-name.frm"

Incorrect information in file: './the-table-name.frm'

我能够从Web主机上获取与数据库关联的.frm文件.

I was able to get a hold of the .frm files associated with the database from the web host.

里面还有其他数据,但是如果我至少能得到电子邮件地址,那会没事的.

There is other data in there, but if I could at least get the email addresses, I would be alright.

如何恢复该数据库? 我愿意付钱给人解决这个问题.

How do I recover this database? I would be willing to pay somebody to fix this.

推荐答案

这属于serverfault.

This belongs on serverfault.

首先,.FRM文件不包含您的数据"中的所有 .它们只是表的定义.

First, .FRM files contain none of your "data". They are simply the definition of the table.

如果满足以下条件的 all :

If all of the following are true:

  • 表正在使用MyISAM存储引擎
  • 您知道重新创建表所需的CREATE TABLE语句

然后,执行以下操作:

  1. 停止MySQL
  2. 备份table_name.frm,table_name.MYI,table_name.MYD文件
  3. 从您的mysql数据目录中删除它们(通常是/var/lib/mysql)
  4. 启动MySQL
  5. 再次创建表
  6. 停止MySQL
  7. 将.MYD和.MYI文件复制回datadir,替换那里的文件.
  8. 启动MySQL
  9. ???
  10. 利润
  1. Stop MySQL
  2. Backup your table_name.frm, table_name.MYI, table_name.MYD files
  3. Delete them from your mysql data directory (/var/lib/mysql usually)
  4. Start MySQL
  5. CREATE the table again
  6. Stop MySQL
  7. Copy the .MYD and .MYI files back into the datadir, replacing the ones there.
  8. Start MySQL
  9. ???
  10. Profit

这篇关于如何恢复MySQL数据库:文件"./xxx.frm"中的信息不正确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆