Thursday, 3 May 2012

Moving a Mysql Database File Windows 7

Operating System:

Windows 7


Problem: 

So i have installed a huge MySQL database on my main drive which is very small and after everything was finished i had even fewer space left. So i had two options either moving the database or importing it again. Since it took about 4-5 hours to import it it would have been a waste a time so the only thing i could do was move it.

Solution:

Stop the server.

If you install MySQL like me without looking the data files are in C:\ProgramData\MySQL\MySQL Server 5.5
Move the data file in this folder.
Edit the my.ini file (remember you have to be a administrator to actually edit the file so open as administrator).
Change this line: "datadir" with the new location of the data folder

Restart the server.

0 comments:

Post a Comment