MynaG's Bits n Bytes

26 Aug, 2011

How to recover or restore MYSQL database with only frm, myd, myi files in Windows

Posted by: mynag In: Miscellaneous

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 Filesfolder.

  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 <STOP>. Once it has stopped, you will it’s status become blank instead of <Started>.
  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 <Start> 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.
Tags: ,

1 Response to "How to recover or restore MYSQL database with only frm, myd, myi files in Windows"

1 | S77sh

June 25th, 2013 at 5:53 pm

Avatar

Thank you for guidance!!

Comment Form

Categories

About

Welcome to MynaG's Bits and Bytes. My little journal containing bits and bytes of the internet, web programming and etcetera