How to install and run XAMPP together with IIS and MySQL Server already installed on same computer

Categories: ,

In this post, we will discuss how to install and run XAMPP considering two different scenarios – (1) How to install and run XAMPP in normal situation, and (2) How to install and run XAMPP together with IIS and MySQL Server already installed on same computer?

What is XAMPP and what are the default ports required to run XAMPP’s Apache and MySQL?

XAMPP is a free and open-source cross-platform web server solution package developed by Apache Friends, consisting mainly of Apache HTTP Server, MySQL/MariaDB database, and interpreters for scripts written in the PHP and Perl programming languages.

XAMPP comes with its own Apache Web Server, MySQL Server, Tomcat etc. Apache uses HTTP port 80 and MySQL uses port 3306 by default.

Before you start the installation of XAMPP check whether you already have a web server installed. Also check whether you have MySQL server installed already on the computer. This will help you know about your environment and take necessary steps later.

Watch the tutorial video below on How to install and run XAMPP together with IIS and MySQL Server already installed on same computer

The video addresses the following points related to installation of XAMPP on a computer with IIS and MySQL Server already installed, and the issues that you may likely face.

  • How to install and run XAMPP on a computer with IIS and MySQL Server already installed?
  • How to change MySQL Port 3306 to 3307 so that we can run XAMPP MySQL on the same computer where MySQL Server is already installed.
  • How to change the XAMPP Apache port from 80 to 8080 so that we can run XAMPP Apache on the same computer where IIS Server is already installed.
  • This post will also address the erros we may encounter with XAMPP on a computer where IIS and MySQL Server are already installed such as:
    • MySQL Service detected with wrong path
    • Change XAMPP MySQL settings or Uninstall/disable the other service manually first
    • Problem detected!- Port 3306 in use by “mysqld.exe”! MySQL WILL NOT start without the configured ports free!
    • You need to uninstall/disable/reconfigure the blocking application 12:35:23 [mysql] or reconfigure MySQL to listen on a different port

If you do not want to go through the video, you can read the paras below the video.

 

1) How to confirm if you have any web server such as IIS server installed on the computer already.

As you may already know, web servers need the port 80 for HTTP and port 443 for HTTPS. And normally, the web server is access using the http://localhost, where port number is not specified by it is using port 80 by default. You can also open the same http://localhost by specifying the port number 80 like this http://localhost:80, which will open the same page.

Steps to check if web server is installed on the computer:

  • Open a web browser and type ‘localhost
  • You should get the web server’s page if web server is already installed. If the web server is an IIS server, you will get the default IIS Page if the web server is running. That means port ’80’ is already taken.

You can also try access with https://localhost to check whether port 443 is also already in use. If the page opens with HTTPS, that means port 443 is already in use.

2) How to confirm if MySQL server is already installed on the computer or not

Steps to check if you have MySQL Server already installed or not, that is, steps to check if MySQL port 3306 is already in use or not. There are several ways to check if MySQL Server is already installed or not. But you can check with the two simple steps below:

  • From List of Programs installed:
    • Open Control Panel in Windows and go to Control Panel\All Control Panel Items\Programs and Features.
    • Look for a program by the name MySQL Server.
    • If MySQL Server exists in the list of programs, it means MySQL Server is installed. So most probably, the default 3306 port is already taken.
  • From Services
    • Press Win Key + R and type “services.msc” and hit enter.
    • In the first column (name), search for MySQL.
    • If MySQL exists, MySQL server is already installed. So most probably, the default 3306 port is already taken.

3) How to install and run XAMPP in normal situation

How to install and run XAMPP in normal situation. Here, by ‘normal situation’ means web server such as IIS, and MySQL Server is not installed on the computer already.  In a normal situation, you can straight away download XAMPP and install on your computer without any additional configuration changes required.

  • Download XAMPP from Apache Friends website
  • Run the XAMPP installer
  • Follow the instructions on screen to install
  • After the installation completes, start the XAMPP Control Panel.
  • Start the APACHE SERVICE, MYSQL SERVICE and other services you required.
  • Normally, these services should start normally since the ports 80,443, 3306 required by Apache WebServer and MySQL would be available.

xampp-control-panel

If you already had other web server such as IIS installed already on the same computer, then port 80 will not be available to XAMPP Apache and you will get some error in XAMPP. Likewise, if you had MySQL server already installed on the computer, then port 3306 will not be available to XAMPP MySQL and you would get some error message in XAMPP.

4) How to install and run XAMPP together with IIS and MySQL already installed on the same computer

If you already have some web server installed on the computer, then port 80, 443 may not be available. Likewise, if MySQL Server is already installed then port 3306 would not be available for XAMPP MySQL. Remember, XAMPP comes with its own MySQL server packaged in XAMPP. In this case, you need to do some additional configurations so that you can continue to use XAMPP Apache and XAMPP MySQL with custom port numbers. In this post, we will take the scenario of XAMPP installation where IIS and MySQL Server 5.5 is already installed on Windows Computer.

  • First, confirm whether you have IIS Server and MySQL server are already installed on the computer. See the steps described above.

Steps to install and run XAMPP together with IIS and MySQL already installed on the same computer

  • Download XAMPP from Apache Friends website
  • Run the XAMPP installer
  • Follow the instructions on screen to install
  • After the installation completes, start the XAMPP Control Panel.
  • There should be some message already about ports not available.
  • Try to start APACHE  and MySQL  from the XAMPP Control Panel.
  • There would some errors as shown below.

xampp-apache-mysql-error-80-3306

Error in XAMPP related to MySQL Port:

12:35:23 [mysql] MySQL Service detected with wrong path
12:35:23 [mysql] Change XAMPP MySQL settings or
12:35:23 [mysql] Uninstall/disable the other service manually first
12:35:23 [mysql] Found Path: "C:\Program Files\MySQL\MySQL Server
5.5\bin\mysqld" --defaults-file="C:\Program Files\MySQL\MySQL Server5.5\my.ini" MySQL
12:35:23 [mysql] Expected Path: c:\xampp\mysql\bin\mysqld.exe --defaults-file=c:\xampp\mysql\bin\my.ini mysql
12:35:23 [mysql] Problem detected!
12:35:23 [mysql] Port 3306 in use by "mysqld.exe"!
12:35:23 [mysql] MySQL WILL NOT start without the configured ports free!
12:35:23 [mysql] You need to uninstall/disable/reconfigure the blocking application or reconfigure MySQL to listen on a different port

4.1) Fix for the error in XAMPP related to MySQL Port 3306:

The error messages in XAMPP Control Panel already tells us that MySQL Service already exists, port 3306 is already in use and which path it is. You can confirm that MySQL service is already running or exists from services.msc in Windows.

How to fix the MySQL port 3306 issue in XAMPP we need to change the MySQL port from 3306 to something else like 3307.

Change XAMPP MySQL port from the default 3306 to 3307

      • Start XAMPP Control Panel as Administrator
      • On XAMPP Control Panel > Click  ‘CONFIG’ button for ‘MySQL’ > Click on ‘my.ini
        The Apache my.ini file will open in a Notepad.
        Alternatively, you can browse to this directory “C:\xampp\mysql\bin\” and open the “my.ini” file in a notepad.
      • Find the port 3306 at two places and change it to 3307.
      • Find the line ‘port=3306‘ which is under [client] and change it to ‘port=3307’
      • Find ‘port=3306‘ again, and under [mysqld], change it to ‘port=3307’
      • Save the file.

Now attempt to start the MySQL service. If all is well, the MySQL service will start successfully.

Error in XAMPP related to Apache Port:

Problem detected
Port 80 in use by "Unable lo open process” with PID 4!
Apache WILL NOT start without the configured ports free!
You need to uninstall/disable /reconfigure the blocking application or reconfigure Apache and 
the Control Panel to listen on a different port

4.2) Fix for the Apache Error in XAMPP

As discussed the error regarding the port 80 is because IIS server is already installed on the computer, which has already taken the port 80. To run XAMPP Apache together with IIS on the same computer, we need to configure XAMPP so that it used a different port for HTTP / HTTPS.

Change Apache port from ’80’ to ‘8080’ in the httpd.conf configuration file

      • Start XAMPP Control Panel as Administrator
      • From the XAMPP Control Panel > Click on  ‘CONFIG’ button for APACHE > Click on ‘Apache (httpd.conf).
        The Apache httpd.conf file will open in a Notepad
        Alternatively, you can browse to this directory “C:\xampp\apache\conf\” and open the “httpd.conf” file in a notepad.
      • Press CTRL+F and type ‘Listen 80’ to find.
      • Change ‘Listen 80’ to ‘Listen 8080’
      • Save the file

That’s all.

Now attempt to start the Apache service. If all is well, the Apache service will start successfully at the new port 8080.

To confirm this, click on Admin button from XAMPP Control Panel, and the browser will attempt to start the XAMPP dashboard page at http://localhost/dashboard, which of course will not open. Because, XAMPP is still opening the web page using port 80.

Now, if you edit the URL / address in the browser by adding the port 8080 ie.  http://localhost:8080/dashboard , the XAMPP dashboard will open just fine.

If you do not want to do this manually all the time, then we need to configure XAMPP Control Panel to use the port 8080 to open XAMPP Apache Home Page.

4.3) Steps to configure XAMPP Control Panel to open Apache Home Page and phpMyAdmin using port 8080 + how to configure a separate service name for XAMPP MySQL

  • Open XAMPP Control Panel ‘as Administrator’ , ie. with elevated permission.
  • Click ‘Config’ button available near the top right corner of XAMPP Control Panel > next, click “Service and Port Settings
  • Click APACHE tab > change the number in the ‘MAIN PORT’ field to ‘8080‘
  • Click SAVE
  • Click on MySQL tab > change the MAIN PORT number to ‘3307‘ and also change the service name for XAMPP’s MySQL say “mysqlxampp”
    Tip: This is important if you are installing XAMPP to run together with MySQL Server already installed on the computer. So that the XAMPP’s MySQL Service will use a different name from the MySQL Server. You can distinguish this by the different names in the Services list (services.msc).
  • Click SAVE > SAVE to exit.

xampp-service-settings

Now attempt to start the APACHE and MySQL services.

  • Click on the ADMIN button next to APACHE and the default XAMPP Apache page should open using the port 8080.
    The URL will look like this: http://localhost:8080/dashboard/ (Note the port number 8080).
  • Click on the ADMIN button next to MySQL and the default XAMPP phpMyAdmin page should open using the port 8080 also.
    The URL will look like this: http://localhost:8080/phpmyadmin

If you see some errors at the phpMyAdmin page (http://localhost:8080/phpmyadmin), don’t worry. We’ll fix one by one.

5) How to run XAMPP Apache and MySQL as Service

So you have successfully configured Apache and MySQL for XAMPP, and you were able to successfully start the Apache and MySQL services. But are you wondering why MySQL is not visible in the services? Do you have questions like “How to enable XAMPP MySQL in services.msc?”

XAMPP’s MySQL will also show in the services list if you enable MySQL to run as a service from the XAMPP Control Panel.

To run Apache and MySQL as service, do the following:

  • Open XAMPP Control Panel ‘as Administrator’ , ie. with elevated permission.
  • Do not start the services yet.
  • Tick the Check Box just before the name Apache and MySQL – this will enable Apache and MySQL to start as a service.
  • You can confirm this from services.msc
    • Press Win Key + R and type “services.msc” and hit enter.
    • In the first column (name), search for MySQL.
    • You should be able to see but MySQL (from MySQL Server 5.5 previously installed) and  XAMPP’s MySQL service “mysqlxampp” in the list of services.

6) XAMPP phpMyAdmin is not displaying a login page.
How to enable login page for phpMyAdmin?
How to setup phpMyAdmin to use cookie authentication?

To enable login page for XAMPP phpMyAdmin, do the following.

XAMPP phpMyAdmin, depending on its configuration (i.e. config.inc.php) will display an identification form, asking for a login and password.

To get that login form, you should not use :

$cfg[‘Servers’][$i][‘auth_type’] = ‘config‘;

  • Open the file config.inc.php available in C:\xampp\phpmyadmin\ in a notepad.
  • Search for “$cfg[‘Servers’][$i][‘auth_type’] = ‘config’;”
  • Change “config” to “cookie”. Now it should look like this:

$cfg[‘Servers’][$i][‘auth_type’] = ‘cookie‘;

xampp-phpMyAdmin cookie authentication.png

 

 

 

 

 

  • Save the file config.inc.php
  • Now, Open the XAMPP Control Panel > Click on the ADMIN button next to MySQL and the default XAMPP phpMyAdmin page should open using the port 8080 also.  The URL will look like this: http://localhost:8080/phpmyadmin

You should be able to see a login page for phpMyAdmin.

Note:

  • ‘config’ authentication ($auth_type= ‘config’) is the plain old way: username and password are stored in config.inc.php.
  • ‘cookie’ authentication mode ($auth_type =’cookie’) as introduced in 2.2.3 allows you to log in as any valid MySQL user with the help of cookies. Username and password are stored in cookies during the session and password is deleted when it ends.

6) phpMyAdmin is opening MySQL Server instead of XAMPP MySQL / Change Port of Mysql Server in XAMPP phpMyAdmin

This is a common situation on computers where both MySQL Server and XAMPP is installed. phpMyAdmin connects to MySQL Server instead of the XAMPP MySQL Server.

How to confirm whether phpMyAdmin is connecting to MySQL Server or the XAMPP MySQL Server.

To to confirm whether phpMyAdmin is connecting to MySQL Server or the XAMPP MySQL Server., you can do the following:

Let’s assume we have MySQL Server 5.5 installed and XAMPP installed on the same computer.

  • Open XAMPP and click on the ADMIN button next to MySQL and to start phpMyAdmin > http://localhost:8080/phpmyadmin
  • Create a new database by the name ‘dbtest123’ from phpMyAdmin. You should be able to see the new database created in phpMyAdmin.
  • Now, open MySQL browser (whichever you are using- such as MySQL Workbench) and connect to the MySQL Server 5.5.
  • If you see the new database ‘dbtest123’ in there, then it confirms that phpMyAdmin is actually connected to the MySQL Server 5.5. and not the XAMPP’s MySQL Server.
  • Likewise, you can drop the dataabse ‘dbtest123’ from the MySQL browser, and then check in phpMyAdmin whether the database ‘dbtest123’ is also gone in phpMyAdmin. If yes, then this confirms that phpMyAdmin was actually connected to the MySQL Server 5.5. and not the XAMPP’s MySQL Server.

If you could confirm that phpMyAdmin is actually connecting to MySQL Server and not to the XAMPP MySQL Server, do the following to rectify this.

  • Click on the ADMIN button next to MySQL and the default XAMPP phpMyAdmin page should open using the port 8080 also.
    The URL will look like this: http://localhost:8080/phpmyadmin
  • phpMyAdmin from XAMPP will open but it is actually connect to the MySQL Server instead of the XAMPP MySQL Server. This normally happens on a computer where MySQL Server is installed already.
  • phpMyAdmin should actually connect to the XAMPP’s MySQL Server database and not the MySQL Server database.
  • To let phpMyAdmin connect to the XAMPP’s MySQL Server database, we need to configure XAMPP’s phpMyAdmin. Follow the steps below.
    • Open the file config.inc.php available in C:\xampp\phpmyadmin\ in a notepad.
    • In the Authentication type and info, add the following line.

$cfg[‘Servers’][$i][‘port’] = ‘3307’;

phpmyadmin-mysql-port

    • Save the file config.inc.php
  • Click on the ADMIN button next to MySQL and to start phpMyAdmin > http://localhost:8080/phpmyadmin
  • You should be presented with a login screen if you have enabled cookie authentication discussed above.
  • Enter root as the username.
  • As per my settings above, ‘AllowNoPassword’ is set to TRUE. So I will leave the password field blank and login. If I enter password, it will throw and error.
  • This time we should be connected to the XAMPP MySQL. But to confirm that you have actually connected to the XAMPP MySQL server, you can create a dummy database ‘dbtest2’ from phpMyAdmin, and then check from your usual MySQL Browser and connect to MySQL Server 5.5 (or whatever your MySQL version is) and check whether the new database also appears there also or not. It should not appear.
  • If you have confirmed this, then you can be rest assured that the phpMyAdmin is connected to the XAMPP’s MySQL Server.
  • This can also be confirmed from the IP Address displayed in the phpMyAdmin. It shows 127.0.0.1: 3307

phpmyadmin-server-port-3307

 

 

7) How to change the root password of MySQL for XAMPP on localhost

Follow the steps below to change the root password of MySQL for XAMPP on localhost:

  • Open XAMPP Control Panel > Click on the ADMIN button next to MySQL to open the phpMyAdmin page
    Or you can also manually open http://localhost:8080/phpmyadmin in a web browser
  • Click on user accounts
  • On the user section > Find the root user and click [ Edit privileges ]
  • In the top section, you will find change password button [ click on it ]
  • Enter the password for the root user and retype the password in the field provided
  • Click on the Go button.
  • Now go to C:\xampp\phpMyAdmin directory and open [ config.inc.php ] file in any text editor
  • Find  $cfg[‘Servers’][$i][‘auth_type’] = ‘config’; line and change ‘config‘ to ‘cookie
    Skip this if you have already done before.
  • Find $cfg[‘Servers’][$i][‘AllowNoPassword’] = true; and change ‘true‘ to ‘false
    This will disable the ‘no password’ login.
  • Save the file.

Test:

  • Close the phpMyAdmin page open
  • Open XAMPP Control Panel > Click on the ADMIN button next to MySQL to open the phpMyAdmin page
    Or you can also manually open http://localhost:8080/phpmyadmin in a web browser
  • You should be presented with a login page to enter the phpMyAdmin
  • Enter root as the username and the password
  • You should be able to login with the username and password if everything we have done so far is correct.

 

So, we have covered various points on How to install and run XAMPP together with IIS and MySQL Server already installed on same computer. Hope the post would be helpful to some of you. If there are some required settings or steps we missed in this post, do let us know in the comments below.

Previous

How to vote for India’s Got Talent on Sony Liv App

How to disconnect OneDrive from Microsoft Office Word, Excel etc.

Next

Leave a Reply

Discover more from Techubber

Subscribe now to keep reading and get access to the full archive.

Continue reading