0

This question is a duplicate. The previous question on StackOverflow is: https://stackoverflow.com/questions/25471631/xampp-mysql-wont-start-even-after-changing-ports and it hasn't been answered (poor OP) - which is why I am asking again now.

When I first turned on XAMPP, mySql56 was using port 80. This conflicted with Apache's default settings which were set to use 80 and 443. I disabled mySql56 and also didn't allow it to start automatically. Now, Apache works when I click "Start" on XAMPP.

Now I want to turn on MySQL. When I click on MySQL "Start", the console shows "Problem detected! Port 3306 in use by "C:/Program Files/MySQL/MySQL Server 5.6/bin\mysqld" --defaults-file="C:/ProgramData\MySQL\MySQL Server 5.6\my.ini" MySQL56"! MySQL WILL NOT start without the configured ports free..."

Indeed, when I open the mysql_error log, around about line 20, it does say "Do you already have another mysqld server running on port: 3306?" Turns out, a service called mysqld.exe is using port 3306.

What I first don't understand is how a MySQL service (mysqld.exe) is using 3306 and XAMPP/MySQL is saying someone is using port 3306? In other words, they can't use 3306 because they are using it!

Secondly, I went into the MySQL config file (my.ini) and changed all references to 3306 to 3308. I also changed it in the file called "php.ini" on C/Program Files/xampp/php. Yet when I try to run it again, it is still trying to get onto port 3306 (which again, is being used by itself) despite my changes on the configuration file.

So my objective is to successfully turn on MySQL on XAMPP.

Community
  • 1
  • 1
Gil
  • 515
  • 2
  • 10
  • 24

1 Answers1

0

Follow this procedure : How to change XAMPP apache server port?

It explains how resolve apache port issues in 4 steps :

  1. Choose a free number port
  2. Edit the file "http.conf"
  3. Edit the file "http-ssl.conf"
  4. Configure XAMPP Apache server settings

If you still have problem, you need to configure mysql port manually with bellow procedure.

Change mysql port :

  1. Stop the xampp server, if it is already running.
  2. Edit the couple values to "port" in xampp/mysql/bin/my.ini
  3. Edit a couple of default MySQL "port" settings in the xampp/php/php.ini
  4. Start mysql service

If still not work :

This means that an other application uses all available ports or dynamically change.

For exemple Skype port is dynamic, it can change the port if it is already occupied.

Simpler solution is to exit Skype or other application, and then start Apache, then start Skype or other application again. This is one time operation and solves the problem.

Community
  • 1
  • 1
Antoine Subit
  • 9,803
  • 4
  • 36
  • 52