52

Our system crashed and we're trying to recover our data. The disc is fine, but the OS is gone, so I'm trying to get at the actual MySQL database files.

Does anybody know where to look for them in a Debian Linux server?

arok
  • 623
  • 1
  • 5
  • 7

2 Answers2

68

MySQL stores DB files in /var/lib/mysql by default, but you can override this in the configuration file, typically called /etc/my.cnf, although Debian calls it /etc/mysql/my.cnf.

Warren Young
  • 71,107
  • 16
  • 178
  • 168
  • 1
    In Debian default setup, you need to be root to view the contents of /var/lib/mysql, just to make it clear. As user, you'll see an almost empty directory if you do: ls /var/lib/mysql – Lizardx Feb 07 '16 at 23:05
-1

Check /opt/lampp/var/mysql/ also. It is the database directory for the XAMPP program.

Jeff Schaller
  • 66,199
  • 35
  • 114
  • 250