Saturday, January 9, 2010

Multiple MySQL on Vista

Even though I don't have it fully working yet, here are the steps that I have taken:
  • Copy the installed data directory (with a new name obviously)
  • Copy the installed my.ini to new.ini and edit accordingly (see notes below)
  • Copy the installed innodb directory (with a new name obviously)
  • Install a new service to start the new instance (this was trickier than I thought but see notes below)
Edits to my.ini

Install a New Service via Command Line
There were two things that I came across:
  • When running the console, you must 'Run as Administrator' which is accessible if you right-click the shortcut for the console.
  • The syntax for adding the mysql executable with the correct options was tricky.  Basically, you must escape the double-quotes with a backslash as in the following example.  
  • Note that apparently the caret ^ is an escape character for most other command line characters.
  • Note also that the space after binPath= is apparently required.
sc create "MySQL whatever" binPath= "\"c:\yourpath\mysql\bin\mysqld-nt\" --defaults-file=\"c:\yourpath\mysql\new.ini\" MySQL"