How to find Data Directory Location in MySQL on Windows Machine - MySQL DBA Tutorial

How to find Data Directory Location in MySQL on Windows Machine


There are multiple ways to find the location for Data Directory Location for MySQL on windows machine.

1) By using @@datadir:
If you are already connected with MySQL Server, you can run below query to find out the data directory location.

mysql > Select @@datadir;




2) Check value of datadir in my.ini file

You can go to my.ini file and find the line datadir=, that is the path for your data directory. In case of default installation, you will find ini file in C:\ProgramData\MySQL\MySQL Server 8.0.



Video demo, how to find the data directory for multiple MySQL servers installed on Windows