LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
LinkBack Search this Thread
Old 01-10-2009, 11:57 AM   #1
DJOtaku
Member
 
Registered: Oct 2004
Location: USA
Distribution: Fedora 16; Arch; Linux Mint/Ubuntu
Posts: 643

Rep: Reputation: 31
How can I get data out of MySQL if I can access the HD, but not run MySQL


Computer I was running a server on died. The HD works, but has problems booting. Basically it complains that it's in the wrong computer or something. I'm pretty sure all the data's ok.

So I can't run MySQL because I can't boot into the OS that was previously running on there. Is there somewhere - like in /var where the database is stored that I could just copy to another HD and then have my database contents?

Thanks!
 
Old 01-10-2009, 02:16 PM   #2
KrytenUK
LQ Newbie
 
Registered: Jan 2009
Posts: 5

Rep: Reputation: 0
Hi DJOtaku,

Quote:
Is there somewhere - like in /var where the database is stored
Im no expert but on my setup the databases are located in /var/lib/mysql/
If you get no joy there you can always try to look in the /etc/my.cnf and find the datadir entry, this will tell you where they are located.

Quote:
So I can't run MySQL because I can't boot into the OS that was previously running on there.
If you can't access the drive via the OS then you will have to either employ the services of a data recovery company or if you have a second harddrive then you can install a new OS on that and mount your other drive later. This is the set-up I use, the primary drive holds the OS and programs etc, the second is set up as /home which contains all my files.

Hope this is of some help.

Regards
Garry
 
Old 01-11-2009, 01:22 PM   #3
hob
Senior Member
 
Registered: Mar 2004
Location: Wales, UK
Distribution: Debian, Ubuntu
Posts: 1,075

Rep: Reputation: 45
Provided that the hardware works, you can put in a bootable Linux disc (like the standard Ubuntu CD), and use that to get the computer running so that you can transfer files from it.
 
Old 01-11-2009, 06:07 PM   #4
DJOtaku
Member
 
Registered: Oct 2004
Location: USA
Distribution: Fedora 16; Arch; Linux Mint/Ubuntu
Posts: 643

Original Poster
Rep: Reputation: 31
KrytenUK's advice worked! (I also found the same advice on other websites)

I just went to /var/db/mysql and copied that. Then I dropped it into the new server and all I had to do was recreate the user names and grant them privileges on the tables
 
Old 01-11-2009, 07:30 PM   #5
John VV
Guru
 
Registered: Aug 2005
Location: Ann Arbor Mi.
Distribution: OpenSUSE 12.1 & Scientfic Linux 6.1
Posts: 7,292

Rep: Reputation: 706Reputation: 706Reputation: 706Reputation: 706Reputation: 706Reputation: 706Reputation: 706
you can copy the db files over to a new machine .I have done this with "lamp" on fedora and "wamp" on xp and the db reads just fine .
 
  


Reply

Tags
mysql, recovery


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
need to get data from xml file to MySQL database, and then use php to access Armon Linux - General 1 01-18-2006 02:54 PM
Access old data with newly installed MySQL dt4stat Linux - Newbie 5 12-05-2005 01:51 AM
Access old data with newly installed MySQL dt4stat Linux - Enterprise 3 05-06-2005 06:11 PM
MySQL Access problem from Aqua Data Studio stedo Linux - Software 0 10-03-2003 02:57 AM


All times are GMT -5. The time now is 05:48 AM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration