MynaG's Bits n Bytes

26 Aug, 2011

Where is the MYSQL database files located in Windows?

Posted by: mynag In: Solutions & Tips|Windows

How to find the location of the MYSQL database files.

The most straightforward method is to look for the my.ini file in the folder where MYSQL is installed.

If you leave the installation path as default, it should be at the following path:
C:\Program Files\MySQL\MySQL Server XX.XX (where XX.XX is the MYSQL version no. )

Open the my.ini using notepad and search for the text datadir.
It should look something like this.

datadir=”C:/ProgramData/MySQL/MySQL Server 5.5/Data/”

That indicates where your MYSQL database files is stored on your computer.

Do note that InnoDB tablesapce files or the ibdata file by default configuration should be stored together with the data files in the data folder. However, it could be located in another location depending on the specified folder you have set during the installation.

Similary, check the location of the ibdata file in the my.ini file

innodb_data_home_dir=”C:/MySQL Datafiles/”

What if you have uninstalled your MYSQL?

If you cannot find my.ini or their backup files (my*****.ini.bak) in the installed folder, be glad that MYSQL will not removed the database files after uninstall, so it should still be there somewhere.

Usually by default it is in the C:\Program Files\MySQL\MySQL Server X.XX\data (X.XX is the MYSQL version no) folder. In some cases, for Windows XP, it can also be in the C:\Documents and Settings\All Users\Application Data\MySQL\MySQL Server XX.X\data folder or C:\Users\All Users\MySQL\MySQL Server 5.5\data folder for Windows 7 or Windows Vista . There is also a possibility that you have both folder, just make sure you got the correct one which is the one with your database name as folders in it.

In the data folder, you should be able to see some folders that were named after your database and a few files such as ib_logfile0, ib_logfile1 or  ibdata1.If you do not have any of the folders in those location I have mentioned, I suggest you do a file search and look for this ib_logfile* or ibdata* for InnoDB location.



No Responses to "Where is the MYSQL database files located in Windows?"

Comment Form



Welcome to MynaG's Bits and Bytes. My little journal containing bits and bytes of the internet, web programming and etcetera