Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

MySQL Database Error - Lost files recovered

Posted on 2011-03-09
3
Medium Priority
?
377 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 51

Accepted Solution

by:
Steve Bink earned 2000 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 51

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

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

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

This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses
Course of the Month12 days, 9 hours left to enroll

971 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