where is mysql server's default data folder in windows 7

0 votes
asked Jan 20, 2010 by nit

I am looking for the data directory of mysql server (5.1.42) I installed on my machine which runs win7.

There is no 'data' direcotory in C:\Program Files\MySQL\MySQL Server 5.1 and also in C:\Users\MyAccount\AppData\Local||LocalLow||Roaming

9 Answers

0 votes
answered Jan 10, 2011 by vladislav-vaintroub

Must be C:\ProgramData\MySQL\MySQL Server 5.1\data.

Was not really a good idea to place data here by default. It is compatible with various Vista compatibility requirements, but is eather hard to find, especially given the ProgramData folder is hidden.

0 votes
answered Jan 9, 2012 by m-kahlani

After changing the directory, the root password is reset. So, keep in mind, if you change the directory, and have access issues, try to access it without a password then set a new password.

0 votes
answered Jan 9, 2013 by noman

You can find the data directory at this location C:\ProgramData\MySQL\MySQL Server 5.5\data\<YourDataDirectory\TableName.frm>

0 votes
answered Jan 28, 2013 by user2530225

Take a look at:

C:\Users\All Users\MySQL\MySQL Server 5.1\data

0 votes
answered Jan 5, 2014 by cris

Different MySQL/Windows versions have different data folder locations. To get your ACTUAL data folder location just execute this SQL:

SHOW VARIABLES WHERE Variable_name LIKE '%dir'
0 votes
answered Jan 7, 2016 by martin

I have had the problem to find the data directory too and even to start the mysql the second time after installing the server 5.7 on Windows 7.

In contrary to some answers here and to the documentation (the part about location of my.ini), the my.ini location was c:\ProgramData\MySQL\MySQL Server 5.7\my.ini the data location was c:\ProgramData\MySQL\MySQL Server 5.7\Data. In fact it was to see, as default proposed data location, during the installation.

0 votes
answered Jan 18, 2016 by guillermo

This is what worked for me on Windows 7:

c:\ProgramData\MySQL\MySql Server 5.7> xcopy data c:\MySQL\"MySQL Server 5.7"\data\

After that, run MySQL server with:

c:\MySQL\"MySQL Server 5.7"\bin> mysqld

Thanks to those who shared the information that C:\ProgramData was a hidden directory!

0 votes
answered Sep 15, 2017 by zgormez

Windows version independent answer.

For MySQL 5.7 on Windows, directory for log files and databases is


The Windows system variable %PROGRAMDATA% defaults to C:\ProgramData

source: https://dev.mysql.com/doc/refman/5.7/en/windows-installation-layout.html

0 votes
answered Sep 15, 2017 by aleks-vidmantas

If you installed mysql with the MSI installer, look here: C:\ProgramData\MySQL\MySQL Server 5.7\ and you should see the data folder. Even thought my datadir is specified to be located in the default mysql server location, my data is stored in %ProgramData%.

Welcome to Q&A, where you can ask questions and receive answers from other members of the community.
Website Online Counter