如何从.FRM恢复我的MYI,MYD表 [英] how to restore my MYI, MYD tables from .FRM

查看:127
本文介绍了如何从.FRM恢复我的MYI,MYD表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
如何从.myd,.myi, .frm文件

Possible Duplicate:
How to recover mysql db from .myd, .myi, .frm files

我已经在这里看到了这个问题,但老实说无法理解所发布的任何解决方案.我刚刚在遇到一些问题后重新安装了Windows Vista,我为Mysql的旧安装直接复制了整个"data"文件夹. MySQL的原始和新安装的版本是5.0.85.

I have seen this question on here but to be honest cannot understand any of the solutions posted. I've just reinstalled windows vista following some problems and i DID make a copy of the entire 'data' folder for the old installation of Mysql. The original and newly installed version of MySQL was, 5.0.85.

phpMyAdmin的原始版本是3.2.1,但是我现在安装了最新版本:3.5.3.问题是我丢失了一些我认为是表和索引文件的MYI和MYD文件.存在所有.FRM文件和一个ibdata1文件(以及ib_logfile0和ib_logfile2).

The original version of phpMyAdmin was, 3.2.1 but ive now installed the latest vers: 3.5.3. Problem is i've lost some MYI and MYD files which i believe are the tables and index files. All the .FRM files are present and a, ibdata1 file (also, ib_logfile0 and ib_logfile2).

表在phpMyAdmin中的某些屏幕中显示,例如分配表级特权"下拉菜单-因此它们似乎仍然存在,但未显示在左列中,左列显示了aDB中的所有表.它们是可以永久恢复还是丢失的?我将不胜感激,如果有足够的帮助可以帮助新手了解.我之前已经安装了WAMP,但从未遇到过此问题.

The tables show up in phpMyAdmin in some screens such as the 'assign table level priviledges' drop down menu - so they seem to be still there but they dont show up in the left column which shows all tables in aDB. are they recoverable or lost for good?? I would appreciate any help in enough detail to understand for a newbie. I've setup WAMP before but never run into this issue.

在此先感谢...

推荐答案

.frm文件仅包含有关表结构的元数据.它们不包含您的数据.

The .frm files just contain metadata about the structure of the table. They don't contain your data.

对于MyISAM表,.MYD文件基本上是表(没有元数据或索引);如果不存在,则您的数据也消失了.可能有一种方法可以生成空"文件并重新开始,但是是的.没有它们,您将没有数据.

For a MyISAM table, the .MYD file is basically the table (sans metadata or indexes); if it's gone, your data's gone. There's probably a way to generate "empty" files and start over, but yeah. Without them, you have no data.

.MYI文件包含索引AFAIK.这些可以重新生成,但不能没有数据.

The .MYI files contain indexes, AFAIK. Those can be regenerated, but not without the data.

但是,如果您的表是InnoDB表,则可能是幸运的. InnoDB表不会有.MYD.MYI;本应包含在其中的数据将位于ibdata1中.您可能能够(在停止mysqld之后)将.frmib*文件简单地潜入正确的位置,并让mysqld在重新启动时看到它们.

If your tables were InnoDB tables, though, you might be in luck. There won't be a .MYD or .MYI for InnoDB tables; the data that would have been in them will instead be in ibdata1. You might be able (after stopping mysqld) to simply sneak the .frm and ib* files into the correct positions and let mysqld see them when it restarts.

当然,如果您已经拥有 InnoDB数据文件,这将不起作用-否则,如果这样做,您将最终丢失所有现有的InnoDB表.但是,在那种情况下,您可以将文件放入另一个目录,然后启动一个指向该目录的mysqld实例.足以将表mysqldump作为SQL,因此可以将其导入到新数据库中.

Of course, this won't work if you already have InnoDB data files -- or rather, if it does, you'll end up losing any existing InnoDB tables. In that case, though, you could put the files into another directory and start a mysqld instance pointing at that directory. That would be enough for you to mysqldump a table as SQL, so you can import it into the new database.

这篇关于如何从.FRM恢复我的MYI,MYD表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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