Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recovering DB from FRM, MYD and MYI files - How?

Status
Not open for further replies.

southbeach

Programmer
Jan 22, 2008
879
US
DB created under MySQL version 5.1.32, not sure which engine ...

Using MS Windows, I have been tasked with the assignment of recovering a database from a crashed HD which after installing as a slave drive, I can access the directory where the DB was stored.

So, I have F:\wamp\bin\mysql\mysql5.1.32\data\lost-db-name

I have installed same version of MySQL and created a DB using same name as original DB. I then turned off daemon (all MySQL Services) and copied the "content" of slave directory (not the directory itself) and skipped file name db.opt.

I then start all services and when I open phpMyAdmin, all I can see is 5 out of 27 tables ...

I opened the console, connected to the table and tried commands:
check table [missing-table-name] and repair table [missing-table-name]

but I get errors stating that table does not exist.

Curious thing is that on the Home directory, the database shows a total of 27 tables but when I choose the database to navigate through it, it only shows 5 ... Where and how does it read 27 and then why only 5 are accessible?

Your help will be greatly appreciated!



--
SouthBeach
The good thing about not knowing is the opportunity to learn - Yours truly, 2008.
 
OK, I have solved this problem. For those that may come behind me here is how:

(1) Copy your OLD database directory into the computer where you now have mySQL running
(2) Edit mySQL .ini file and point datadir variable to this directory
(3) Open myPHPAdmin or whatever you use, dump the data
(4) Reverse back to original data directory
(5) Open myPHPAdmin or whatever you use and restore dumped data



--
SouthBeach
The good thing about not knowing is the opportunity to learn - Yours truly, 2008.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top