Server Fault is a question and answer site for system and network administrators. 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

A friend of mine mysql linux server died and I managed to get almost all the data from the hdds... What can I look for to recover his databases and data? Where are they stored and in which files? How can I put those files under a new and healty mysql installation?

Thanks a lot for your time.

share|improve this question
up vote 1 down vote accepted

You can check mysql configuration file /etc/mysql/my.cnf. Usually, you will find a line like:

datadir         = /var/lib/mysql

1- Stop the new mysql server.

2- Copy the datadir including all the files and folders.

3- Check the files owner / permissions.

4- Start the new mysql server.

share|improve this answer

It's installation-dependent, but most MySQLs I've seen keep the databases under /var/lib/mysql, one subdirectory per database.

share|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.