Converting FRM/MYD/MYI database files to SQL

| | Comments (0)

As I mentioned last night, I had to restore some database files. Unfortunately the backup I'd downloaded was in a tarred/gzip file with each database table represented by three files with the extensions frm, myd and myi. After googling a bit (dear Google: please don't bother giving me "Supplemental result" listings if the target page is gone and you don't have a cache copy of it. That's just dumb.) I found that these were raw SQL database files.

The only way to restore them is appeared to be to copy them directly to MySQL's data directory - the problem being that I didn't actually have access to the MySQL data directory on the web server in question. You would think, given that phpMyAdmin had given me these files as a backup that it would have an easy way to restore them, but if it does, I couldn't find it.

The solution ended up being:

  1. Install MySQL and MySQL Administrator on my home PC.
  2. Copy the appropriate table files to the MySQL data directory.
  3. Use MySQL Administrator to make a backup in SQL format.
  4. Use the SQL script from the backup to restore the table on the web site.

Once the tables were restored, I used a couple of SQL statements to copy the data across to the appropriate table, and all was hunky dory.

Leave a comment

About this Entry

This page contains a single entry by Alden published on December 9, 2005 9:37 PM.

Upgrading to eFiction 2 (the revenge) was the previous entry in this blog.

Outing scumbags is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Powered by Movable Type 4.01