Configuring MySQL service on Windows to use a different my.ini file

Posted: December 1st, 2009
By:
Tommy Unger

MySQL 5 conveniently comes with a windows installer which works flawlessly to get the novice user up and running on the ubiquitous open source database. However, another way to put mysql onto a windows box is without the installer by just downloading the zipped binaries.

Once you’ve unzipped the binaries, you have a few steps to take:
Step 1. Run mysqld –install – This will setup the mysql daemon as a windows service. It will look in your windows base directory %WINDIR% for a my.ini file. (On windows the my.conf file is called my.ini, and I have no idea why this is)

Step 2. Open regedit. And change this key
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\MySQL\ImagePath to this:
“<path-to-mysql>\bin\mysqld” –defaults-file=”<path-to-mysql>\my.ini” MySQL
or this, if you just want to use one of the default medium sized instance ini file:
“<path-to-mysql>\bin\mysqld” –defaults-file=”<path-to-mysql>\my-medium.ini” MySQL

Tags:

Leave a Reply

#000000
#1d3147
#415973
#9dacb9
#4c3724
#897661
#d1c8c0
#ffffff