MySQL Question - Where are MySQL Databases Stored on Linux ?

I have a friend, who is a Linux newbie. He is forced to learn Linux, simply because his company is using it. His job title is MySQL Specialist. Today, he pop up a question from the instant messaging, ask me where are the MySQL databases stored on the Linux machine.

My answer is simple, It depends on how your MySQL database server is installed. If you are using Fedora Linux distribution, and you installed MySQL server during Fedora installation or RPM packages from MySQL, then probably your MySQL databases are store under /var/lib/mysql directory.

If a tar file binary distribution is installed by unpacking it at the installation location you choose (typically /usr/local/mysql), then the databases should be at data directory under your chosen directory.

If a source distribution is installed after you configure and compile it. By default, the installation step installs files under /usr/local, then databases should be store under subdirectory var.