Tag Archive: MySQL


So, next on my list of ‘Things to move to D:’, were the MySQL DBs that sit behind a couple of sites I’m tinkering with, plus the DB that sits behind this very website. I’m using MySQL 5.1, but if you’re using a different version, please check before using this procedure, and as always, if you can, take a backup.

The MySQL procedure is quite different to that used for MSSQL, as you will see.

Firstly, stop the MySQL service, because you won’t be able to move a thing if you don’t.

Once the service is stopped, locate the MySQL program directory, which was C:\Program Files\MySQL\MySQL Server 5.1 for my install.

In that directory, locate the file called ‘my.ini’ and open it in notepad. Look for the comment ‘#Path to the database root’ in my.ini, and the very next line should contain the current path to all your DBs.

Locate your DB’s using the path you’ve just found. Copy all of the folders to your new drive, in my case D:\MySQL, and make sure they have the same permissions as before.

Now, go back to ‘my.ini’ and comment out the line beginning ‘datadir=’ that pointed to your original DB path. The # is used to comment out lines in MySQL.

Create a new line beneath it, beginning ‘datadir=’ and add your new path to your DBs.

For example, the line I added was datadir=”D:/MySQL/”. Save the ‘my.ini’ file, and restart MySQL.

That should be it. Check all your DBs are working, and if not, roll back the changes and look at the event logs to see what might be wrong.

Once you’re satisfied everything is working, you can delete the old directory and free up some space.

Good luck!

Now my Windows installation has been moved to its new hardware home, in order to improve perfomance, I decided to do the following:

1. Move my Exchange information stores to the new second drive.

2. Move my MSSQL databases to the new second drive.

3. Move my MySQL databases to the new second drive.

4. Move my IIS6 website content to the new second drive.

This should improve overall performance since these items will no longer reside on the same drive as the O/S, and more spindles means better read/write performance.

Since each one of these tasks is not that difficult, I thought I’d share with the world! So keep an eye open, they are coming soon.