Solved

MySQL Database Error - Lost files recovered

Posted on 2011-03-09
3
370 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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Fore-Foreword Today (2016) Maxmind has a new approach to the distribution of its data sets.  This article may be obsolete.  Instead of using the examples here, have a look at the MaxMind API (https://www.maxmind.com/en/geolite2-developer-package). …
More Fun with XML and MySQL – Parsing Delimited String with a Single SQL Statement Are you ready for another of my SQL tidbits?  Hopefully so, as in this adventure, I will be covering a topic that comes up a lot which is parsing a comma (or other…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

809 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