从恢复的硬盘还原MySQL数据库文件夹 [英] Restore MySQL database folder from a recovered Hard Disk

查看:412
本文介绍了从恢复的硬盘还原MySQL数据库文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我能够在

C:\Documents and Settings\All Users\Application Data\MySQL\MySQL Server 5.5\data\

如何手动将其还原到新的MySQL Server?当我打开文件夹时,我发现了几个文件夹,并且我相信这些是数据库.我没有归档任何SQL文件.

How can I manually restore it to the new MySQL Server? When I open the folder, I found out several folders and I believed those are the databases. I didn't file any SQL Files.

推荐答案

好的,我已经解决了自己的问题.

Ok, I got the answer to my own problem.

可能的情况

  1. MYSQL程序已损坏,无法启动.全新安装MYSQL 没有还原数据.
  2. 计算机崩溃,但硬盘仍在 工作
  3. Windows已损坏,无法启动,但是数据是安全的.
  1. MYSQL program is corrupted and fail to start. Fresh install of MYSQL did not restore the data.
  2. Computer crashed but hard disk is still working
  3. Windows corrupted and fail to start up, but data is safe.

对于您的信息,在MYSQL中,扩展名为MYD的文件是表数据,FRM文件是表定义,而MYI文件是表索引.在my.ini中还指定了ibdata文件,它是InnoDB tableapce文件.您必须是administrator,以便可以访问 Document and Settings 文件夹或 Program Files 文件夹.

For your information, in MYSQL, files with the extension MYD is the table data, FRM files is the table definition and MYI file is the table indices. There is also the ibdata file specified in the my.ini which is the InnoDB tablesapce files. You have to be an administrator, so that you can access Document and Settings folder or the Program Files folder.

  1. 打开Window Explorer(Windows键+ E)或打开我的电脑",然后转到数据库文件所在的数据文件夹.
  2. 我建议您复制数据文件夹中的所有文件夹,而不是只选择要复制的几个文件夹.复制数据库文件夹和ibdata文件(请勿复制ib_logfile(x)文件!) 请注意,ibdata文件可能与数据文件不在同一位置. 要找出可能的位置,请阅读如何在Windows中查找MYSQL数据库文件.
  3. 转到目标计算机,即打开系统服务". (在Windows菜单搜索程序和文件"输入框中键入services.msc)
  4. 在服务"窗口的右侧面板上,滚动列表并查找名称"MYSQL".选择MYSQL,然后单击鼠标右键,然后单击.停止后,您的状态将变为空白,而不是.
  5. 类似地寻找数据文件夹的位置.找到它之后,建议您备份该文件夹或只是对其进行重命名.粘贴从源计算机复制到数据文件夹的文件夹和ibdata文件.
  6. 返回服务"窗口,然后选择返回MYSQL.右键单击它,然后单击以恢复MYSQL服务.
  7. 打开MYSQL管理员并登录到数据库服务器,您应该能够看到传输的数据库及其数据.
  1. Open Window Explorer (Windows Key + E) or Open My Computer and go to the data folder where your database files reside.
  2. I would recommend you to copy all the folders in the data folder than just picking a few to copy. Copy the database folders and ibdata file (DO NOT COPY THE ib_logfile(x) files!) Note that the ibdata file might not be in the same location as the data files. To find out where it could be, read How to find MYSQL database files in Windows.
  3. Go over to the target computer, Open System Services. (Type services.msc at the Windows menu "Search Program and files" entry box)
  4. On the right panel of the Services window, scroll along the list and look for the name "MYSQL". Select MYSQL and right mouse click and click . Once it has stopped, you will it’s status become blank instead of .
  5. Similarly look for the location of the data folder. Once you located it, I recommend you back up the folder or just rename it. Paste over the folders and ibdata file you have copied from the source computer to the data folder.
  6. Go back to the Services window and select back MYSQL. Right mouse click on it and click to resume the MYSQL service.
  7. Open MYSQL administrator and log on to your database server and you should be able to see your transferred database together with their data.

这篇关于从恢复的硬盘还原MySQL数据库文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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