XAMPP and multiple instances of MySQL on Windows

I was setting up XAMPP on a Windows system and came to find out that another instance of of MySQL was already running on the system and listening on the default port 3306. Visually this can be determined after the installation when you start the XAMPP Control Panel and you see a green check in the service box next to MySQL. I did some checks with google and I was able to determine that I’d be able to run multiple instances so I did the following to get this to work.

  • Edit your “my.ini” file in c:\xampp\mysql\bin\
    • Change all default 3306 port entries to a new value ie.) 3307
    • Change the server value [mysql] to [mysqlvalue]
  • edit your “php.ini” in c:\xampp\php
    • find mysql.default_port port 3306 and set it to what was used in my.ini
  • Create the service entry
    • c:\xampp\mysql\bin\mysqld –defaults-file=c:\xampp\mysql\bin\my.ini mysqlweb
  • Open Windows Services and set 
    • Startup Type: Automatic
    • Start the service