0

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.

Pitto
  • 2,009
  • 10
  • 33
  • 49

2 Answers2

1

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.

Khaled
  • 36,533
  • 8
  • 72
  • 99
0

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

MadHatter
  • 79,770
  • 20
  • 184
  • 232