Configuring XCP for non-default MySQL instance

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Configuring XCP for non-default MySQL instance

Postby gregbaatard » 17. December 2010 07:01

Hi,

I need to run a portable version of XAMPP in an environment which already has MySQL running as a service which cannot be stopped. I've set MySQL to use a different port and socket name in my.ini and set those as the defaults for mysql and mysqli in php.ini, but the XAMPP Control Panel is giving me problems.

When I open XCP, it shows that MySQL is already running, as a service. It is detecting the copy that is already on the computer, and since that cannot be stopped I can't start XAMPP's version of MySQL via XCP.

I've already created a xampp.ini file to set the non-standard default port, but it has not helped.

I need a way of making the MySQL button in XCP look for XAMPP's copy of MySQL, which will be running as a process (not a service) on a different port with a different socket name. (I'm not sure if the socket name is important - I changed it in case it helped to avoid conflicts)

Any ideas? I'm not averse to poking the program with a hex editor if possible to fix it like that...
gregbaatard
 
Posts: 3
Joined: 17. December 2010 06:52

Re: Configuring XCP for non-default MySQL instance

Postby gregbaatard » 17. December 2010 07:06

In case it helps at all...
Note that I CAN start and stop XAMPPs version of MySQL via the mysql_start and mysql_stop batch files. I assume those files or the programs they call DO take the configurations into account.

Unfortunately, this is a much clumsier and uglier way of doing it and that is not suitable for the purpose XAMPP needs to serve in this deployment.
gregbaatard
 
Posts: 3
Joined: 17. December 2010 06:52

Re: Configuring XCP for non-default MySQL instance

Postby gregbaatard » 17. December 2010 08:06

Huzzah! I seem to have figured it out on my own!

Used a hex editor (XVI32 is nice and lightweight) to open xampp-control.exe and change the following:

Image

As you can see, I've just added a "2" to the end of "MySQL" in that area. As far as I can tell, this is the section of the code which tells XCP what process/service name to look for with regards to the Start/Stop MySQL button. Saved the file and changed the socket name from "MySQL" to "MySQL2" in my.ini (two instances near top of file) and php.ini (two instances - mysql and mysqli sections).

XCP works perfectly now - the MySQL Start/Stop button controls XAMPP's version of MySQL, and the version running on the PC is unaffected.

Hopefully this will help others! :)
gregbaatard
 
Posts: 3
Joined: 17. December 2010 06:52

Re: Configuring XCP for non-default MySQL instance

Postby JonB » 19. December 2010 01:15

Thanks for the very geeky, but still cool solution~ :shock:

Happy Holidays
8)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 133 guests