LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-21-2009, 01:04 PM   #1
Skillz
Member
 
Registered: Sep 2007
Posts: 252

Rep: Reputation: 32
Recovering mySQL database...


How would I pull the MySQL database data off a old hard drive that is just mounted to a newly installed OS?

Long story short. Hard drive had some data corruption, removed. New hard drive installed, old hard drive mounted to new system.

Now I need to find out how to get the mySQL data assuming it's not corrupted and put it on the new system.

Thanks for any help!
 
Old 03-21-2009, 01:09 PM   #2
puntjuh
Member
 
Registered: Apr 2006
Location: holland
Distribution: Gentoo / debian / suse / mint
Posts: 558

Rep: Reputation: 42
Is your old server harddisk also installed with PHPMyadmin? If so, you can easily EXPORT the database to a zip or gzip or bzip'd file, and move it to another harddisk.

Even easier would be if you could do this remotely from the good harddisk!
 
Old 03-21-2009, 01:28 PM   #3
Skillz
Member
 
Registered: Sep 2007
Posts: 252

Original Poster
Rep: Reputation: 32
It had phpmadadmin installed on the server before the crash and it's installed on there now.

The thing is though, I'm not sure if I access phpmyadmin it will access the "data" on the old hard drive. Only the new.

The old hard drive (one with corrupted files) is mounted/attached to the new hard drive (operating system) so I can browse the physical files directly. Although nothing is running from it. IE: Its just a secondary hard drive mounted to the system.

I think I will have to find the physical data that's stored on the hard drive itself and physically copy/move the data over to another location so I can pull/extract/convert it to use with the new stuff.
 
Old 03-21-2009, 01:36 PM   #4
puntjuh
Member
 
Registered: Apr 2006
Location: holland
Distribution: Gentoo / debian / suse / mint
Posts: 558

Rep: Reputation: 42
AFAIK mysql doesnt save a "file" for every database you create. The only ways i know of to backup are either by phpmyadmin or by mysql command line, but then the server would have to be running.

Perhaps someone else knows of a way here, but i'm sorry, i can't help u further on this problem then . Googling didn't bring any other ways either.


-------------

Nevermind.. this is the solution:

http://stackoverflow.com/questions/4...physical-files

Dont feel like retyping their work! So here's the link, so they get the credit for their answer . I didn't know this either.

Last edited by puntjuh; 03-21-2009 at 01:41 PM.
 
Old 03-21-2009, 01:40 PM   #5
Skillz
Member
 
Registered: Sep 2007
Posts: 252

Original Poster
Rep: Reputation: 32
Yea I'm googling right now trying to figure out the solution. The hard drive is physically in the new system, but it's not the primary hard drive. Maybe I can trick phpmyadmin into thinking the "old" hard drive is it's primary location and pulling the data from there, but I wouldn't even know where to start.

The data has to be stored somewhere, might not be a regular file but it at least has to be some kind of encrypted file of some sort I would think.
 
Old 03-21-2009, 01:48 PM   #6
Skillz
Member
 
Registered: Sep 2007
Posts: 252

Original Poster
Rep: Reputation: 32
Oh thanks!!! Didn't see the edit!!
 
Old 03-21-2009, 02:06 PM   #7
Skillz
Member
 
Registered: Sep 2007
Posts: 252

Original Poster
Rep: Reputation: 32
Hmm, Ok so I moved those files over to the new location. Loaded up Phpmyadmin and I can see the databases... but everything is empty. No tables, no data, nothing. All it says is the database name (0)
 
Old 03-21-2009, 02:13 PM   #8
Skillz
Member
 
Registered: Sep 2007
Posts: 252

Original Poster
Rep: Reputation: 32
Ahh I fixed it. The file ownership was wrong.
 
Old 03-21-2009, 05:16 PM   #9
puntjuh
Member
 
Registered: Apr 2006
Location: holland
Distribution: Gentoo / debian / suse / mint
Posts: 558

Rep: Reputation: 42
ye, the follow-up posts are like a walkthrough! Glad to hear it works now .
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Recovering a Mysql Database after Crash cmfarley19 Linux - Software 7 11-29-2009 12:02 PM
How can i copt the MYSQL Database to a other server (Database) halvorls Linux - Server 3 07-27-2008 09:19 PM
Recovering MySQL database mohtasham1983 Linux - Server 5 02-25-2008 11:05 AM
help recovering database file in open office mifan Linux - Software 2 07-06-2006 05:18 PM
Recovering a mysql database irvken Linux - Software 2 10-09-2005 05:27 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:33 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration