Windows – Specify Data Folder location while installing MySQL on Windows

installationMySQLwindows

When installing MySQL 5.1 on a Windows machine, is it possible to specify where the Data Folder should go? The installer doesn't give an option for changing the Data Folder location, it defaults to "C:\Document and Settings\All Users\Application Data\MySQL\MySQL Server 5.1\".

I'm installing MySQL 5.1.34 on Windows Server 2003.

Follow-up: I ended up manually editing my.ini and pointed datadir to the desired location. I just wish the installer had an option to change the location.

Best Answer

Yes. Have a look at this document:

http://dev.mysql.com/doc/refman/5.1/en/windows-create-option-file.html

You can specify the data folder either in an option file, or on the command-line for the service.

Edit: I just pulled down the MSI and had a look, and I don't see any way to specify the data directory during install w/ an addt'l property on the command line.

You can transform the install with Orca, if you are familiar with Windows Installer, to change the "DataDir" location in the Directory table.

Related Topic