Solved

MySQL Database Error - Lost files recovered

Posted on 2011-03-09
3
369 Views
Last Modified: 2012-08-13
Hi,

I came in to the office yesterday to find that all data in the Data directory on our Mac servers has 'disappeared'.

Since today I've been trying to recover from old scripts we dumped a while ago but the data is so old it's useless.

Anyway, today I used some file recovery software on the mac and found all the files. I've got the now, all the FRM and MYD and a huge ibdata1 and two log files. When I had the issue I installed MySQL 5.5 on to the server, I know, you do things in panic, no idea why....but I have the files in the new data directory on the Mac.

If I go in to Navicat I can see all the table references and all the views etc for the database but when I try to open them it says that the table cannot be found.

Is there something I need to do to 'activate' the new data in the directory?

I also installed a new MySQL server on our windows machine and I'm trying to copy the same Data directory to that to see if it's something to do with permissions as I had to give 'everyone' permission so I could copy the directory.

Sorry if this all sounds a little frantic but ... I am.

Any help would be greatly appreciated!

Best Regards,

Ken


0
Comment
Question by:kenuk110
  • 2
3 Comments
 

Author Comment

by:kenuk110
ID: 35088143
Can anybody help me with this issue, I'm shitting myself that I've lost everything.....
0
 
LVL 50

Accepted Solution

by:
Steve Bink earned 500 total points
ID: 35093019
Have you tried accessing them through the MySQL CLI?

I very commonly use the "frantic" method you described to manually move a database between servers.  I shut down the source and destination MySQL servers, copy the directory for the database, then start them up.  For MyISAM databases, that is all that is needed.  MySQL will automagically inventory the new databases and leave you to worry only about individual user permissions.

The ibdata1 reference, though, implies an InnoDB database, which is likely to have some other requirements.  I have no experience in recovering them from files in this manner, so I cannot provide much advice on that front.  My only suggestion would be to create an InnoDB database, shut down the server, put the old files in place of the new files, and start it back up.  With a healthy dose of prayer.  :/
0
 
LVL 50

Expert Comment

by:Steve Bink
ID: 35093029
And I'm sure this is a fair bit of salt in your wounds, but....a backup plan is only as good as your restore plan, and vice versa.  You should have a backup plan, a restoration plan, and a regular schedule for testing both.
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Get error when search query run in loop 3 44
php image upload 3 37
Insert data into database 2 37
Create a Select Query and Populate a Table 3 45
A lot of articles have been written on splitting mysqldump and grabbing the required tables. A long while back, when Shlomi (http://code.openark.org/blog/mysql/on-restoring-a-single-table-from-mysqldump) had suggested a “sed” way, I actually shell …
I use MySQL for many of my development projects in a Windows environment. To manage my databases (and perform queries) for years I used a tool called MySQL administrator.  This tool has since been replaced by MySQL Workbench. So I decided to m…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now