mysql 硬盘恢复数据_从恢复的硬盘还原MySQL数据库文件夹

bd96500e110b49cbb3cd949968f18be7.png

I was able to recover the database folder of MySQL server 5.5 of the corrupted operating system (Windows XP) at

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

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.

Possible Scenario

MYSQL program is corrupted and fail to start. Fresh install of MYSQL

did not restore the data.

Computer crashed but hard disk is still

working

Windows corrupted and fail to start up, but data is safe.

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.

Open Window Explorer (Windows Key + E) or Open My Computer and go to the data folder where your database files reside.

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.

Go over to the target computer, Open System Services. (Type services.msc at the Windows menu “Search Program and files” entry box)

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 .

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.

Go back to the Services window and select back MYSQL. Right mouse click on it and click to resume the MYSQL service.

Open MYSQL administrator and log on to your database server and you should be able to see your transferred database together with their data.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值