Tuesday, February 19, 2008

Converting FRM/MYD/MYI database files to SQL

I have to restore some database files. Unfortunately I was given files with the extensions frm, myd and myi (raw SQL database files.)The only way to restore them is to copy them directly to MySQL's data directory - the problem being that I do not have access to the MySQL data directory on the web server in question. The phpMyAdmin version I have does not have an import feature, so you have to build .sql queries that create the tables.

  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 of the wp_comments, wp_postsmeta, and wp_posts tables. (To get MySQL admin to work I used the command line to set the root password then log in with the gui using the username 'root' and the server 'localhost'. You may have to permit port 3306 in your firewall too.)

  4. Use the SQL script from the backup to restore the table on the web site.


No comments: