Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My mythtv box crashed because of a corrupted hard drive. I can see my data when connected it to another computer. I need to know how I can retrieve the database so I can load it on my new drive.

share|improve this question

migrated from Mar 15 '10 at 1:34

This question came from our site for professional and enthusiast programmers.

What operating system – MrStatic Mar 15 '10 at 1:44

Use the mysqldump utility :). This option allows you to export the database instead of merely copying the files.

share|improve this answer
Actually, I'm not sure that mysqldump will work on a machine that's not running the mysql server; never tried it. – jrc03c Jul 8 '10 at 18:54
I already tried but mysqldump doesn't work without mysql server running which is not going to happen in an external hdd. – coding_idiot Apr 14 '13 at 6:11

If you are using linux then the databases are stored in /var/db/ generally. If its mysql /var/db/mysql/.

share|improve this answer
/var/lib/mysql is also common, or peek in /etc/my.cnf – nos Jun 28 '10 at 12:44

Go inside the MySQL db directory of the hard drive, there will be some files there for each database. Retrieve them.

Here is the tricky part. You are going to need to get the same version of mySQL from the one that was in the dead box. Once you know what version it was, install it in a new rig and copy over the files.

After that you can use php myadmin or the mysql cli interface to make a proper export.

share|improve this answer

If you can still read from the HD try to copy the db files to a another system running mysql. If the db files are not corrupted you should be able to access the Database.

The db files should reside inside a folder called [db_name]

share|improve this answer
I already tried this, but this didn't worked. Many of them were missing. – coding_idiot Apr 14 '13 at 6:11

Use a data retrieval service if the information is very valuable to you, as any attempt at DIY data retrieval can lessen the chances of a later attempt.

That said, using GetDataBack is a good bet for NTFS or FAT drives (they have two different versions. Here is a guide to help you with Linux HD's (actually the advice will work with any type of HD, but for FAT and NTFS formatted drives you can use GetDataBack).

Hope this helps!

share|improve this answer
He said it's MythTV, and that runs on Linux. Recommending file recovery software for FAT/NTFS filesystems is kind of pointless... – Alexander Burke Mar 15 '10 at 6:27
+1ing because he did put a link for Linux HDs as well. – Hello71 Jun 27 '10 at 16:18

You must log in to answer this question.