Solved

MySQL Database Error - Lost files recovered

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Foreword In the years since this article was written, numerous hacking attacks have targeted password-protected web sites.  The storage of client passwords has become a subject of much discussion, some of it useful and some of it misguided.  Of cou…
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

743 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

11 Experts available now in Live!

Get 1:1 Help Now