Saturday, June 6, 2015

How to configure xampp with already Installed MySQL server

Xampp is a collection of software package which comes with “Apache”, “MySQL”, “PHP” and “Perl”. With this bunch of software you can maintain a web server functions in your local machine. Here with this post I’m going to tell you how to configure xampp in order to run different MySQL servers in same computer without creating a conflict between servers. 

First you have to install xampp in your computer. 



















After successful installation you can open the xampp control panel using setup window or from your start menu or start screen.
Here in my computer I have already installed MySQL server which is use to develop standalone applications using C# or java. So here if you have pre-installed MySQL server here is the way to use both MySQL and xampp’s MySQL server without any errors.



















In your xampp control panel you can see some buttons to start the apache and MySQL server. But below those buttons you can see textual descriptions of the xampp. Here we named it as xampp console. Now in console you can see some red colored texts which are appeared to be errors in xampp control panel. In there  you can see some text looks like this “MySQL Service detected with wrong path ” and list of errors that tell you that MySQL server cannot be started.

The reason is you have already configured MySQL server which is incompatible with xampp.
But you can recover this error by editing the configuration files in xampp.

first   click on apache “Config” button which is located before the “Logs” button. See below image  for a clear view.

Then click on “PHP(php.ini)”. Then a notepad will be opened with some text.


Now press “Ctrl+H” to get the find and replace dialog box. (alternately you can go to edit à replace). Now in find text box type 3306 and in replace box type 3307 and click “replace all”.

After that save the php.ini file and close it. Now again come to xampp control panel and again click on MySQL “Config” button and click on “my.ini”.

Again you are with a notepad. Now again press “Ctrl+H” and type 3306 as find text and 3307 as replace text and click on “Replace All”. Now save changes and close the notepad.

Now in xampp control panel you can see a button named “config” which is located at top right corner below the close button.

Now click on it and click on the “service and port settings” button. Now in this window navigate to “MySQL” tab and use following settings.
            Service name : mysql4
            Main port : 3307












hen click on “save” and again click on “save”.

Now you are almost done.
Now click on “Quit” button to terminate the xampp.




Note : do not close from windows default close button. Because this will not close xampp permanently.
Now open xampp again from your desktop or anywhere.
Now you can see there are no any red colored texts in the xampp console.
Now start your apache and MySQL server. If you are done correctly it will work fine.






Now click on MySQL “Admin” button to access your databases in xampp’s MySQL server.

No comments:

Post a Comment