LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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
  Search this Thread
Old 01-10-2009, 12:57 PM   #1
DJOtaku
Member
 
Registered: Oct 2004
Location: USA
Distribution: Fedora 25;CentOS 7; Kubuntu; Debian
Posts: 860

Rep: Reputation: 37
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, 03: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, 02: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, 07:07 PM   #4
DJOtaku
Member
 
Registered: Oct 2004
Location: USA
Distribution: Fedora 25;CentOS 7; Kubuntu; Debian
Posts: 860

Original Poster
Rep: Reputation: 37
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, 08:30 PM   #5
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,669

Rep: Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657
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



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 03:54 PM
Access old data with newly installed MySQL dt4stat Linux - Newbie 5 12-05-2005 02:51 AM
Access old data with newly installed MySQL dt4stat Linux - Enterprise 3 05-06-2005 07:11 PM
MySQL Access problem from Aqua Data Studio stedo Linux - Software 0 10-03-2003 03:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:50 PM.

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