Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

I copied the data out of my /var/lib/mysql directory which has my database raw data in folders and has things like:


is this enough to re-import the databases to a fresh install of MySQL? Because I am about to re-image the server. if not, what should I do ?


share|improve this question

Make sure you're using the same EXACT version of MySql. .myd contains the data, .frm contains the table structure, and .myi contains the index for your data.

Don't forget to recheck the database using mysql's check table statement.

I've had some success repairing an old mysql version corrupted database without the .myi file.

share|improve this answer

The best option by far is to dump the existing databases to one or more text files and then import it/them into the new system. Mysqldump is the tool to use.

share|improve this answer

I just uploaded all the .MYD, .frm and .MYI files from a MySQL 4 server to a server running MySQL 5.

At first I took the advice I've seen on this site, and didn't copy the .MYI files. I ran a phpmyadmin repair and it said the .MYI files were missing. It didn't re-create them. So I went ahead and copied them over and ran the repair again and everything looked perfect. I was able to browse the tables and see that all the data was intact. And phpmyadmin gave green check marks next to every table.

I haven't had a chance to test the site yet to verify that it's all working, but I'll write back and let you all know.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.