Where is mysql data directory?

Usually mysql data directory resides in the /var/lib/mysql/
By mysql data means all the databases that are created on your mysql server are stored in that directory. The fastest way to check where your mysql data directory resides is to look inside your my.cnf file.

cat /etc/mysql/my.cnf | grep datadir

As I mentioned the default directory is:

datadir = /var/lib/mysql

Leave a Comment