Skip to content

MySQL: Finding the Data Directory Path

June 16, 2015

If you installed MySQL with the default settings and you do not know where is located the default data directory you can do the following:

  1. Go the MySQL installation directory (in my case /opt/mysql)
  2. Go to the bin directory ‘cd bin’
  3. Execute the following command (I’m using root, but you can use any other user):

mysql -uroot -p -e ‘SHOW VARIABLES WHERE Variable_Name = “datadir”‘

You should get an output similar to the following:

| Variable_name | Value        |
| datadir       | /var/lib/mysql/  |

This post is intended for the inexperienced users of MySQL. The procedures and result presented has been tested on Solaris 10 running on a Sparc 64b platform and using MySQL Community Edition ver. 5.6.24


From → Mysql

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: