Solved

MySQL Database Error - Lost files recovered

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

As a database administrator, you may need to audit your table(s) to determine whether the data types are optimal for your real-world data needs.  This Article is intended to be a resource for such a task. Preface The other day, I was involved …
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

820 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