View Full Version : XAMPP MYSQL and Apache problem

12-07-2008, 05:46 PM
Hi to everyone :D

I downloaded and installed XAMPP from the internet in order to view some of the PHP sites on my local machine.

But there is a problem:
-during installation, the wizard asked me if I would like to install Apache and MySQL as services. I choosed both. The rest of the installation went ok, but when it started the xampp console error message appeared:
"Ports 80 or 443 (SSL) already in use! Installing Apache2-2 service failed!"
"Port 3306 already in use! Installing MySQL service failed!"

And when I open XAMPP control panel application and click start (MySQL) it says: "ERROR: MySql service not started [-1]

I managed to open the localhost and I created a sample file just to ensure everything is ok, but when I tried to open a website with MySQL database, again error text appeared:
"Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'mysql2.namesco.net' (10060) in DISK:\www\htdocs\xampp\sitename\dbc.php on line 8
I cannot connect to the database because: Can't connect to MySQL server on 'mysql2.namesco.net' (10060)"

Any ideas?

Thanks in any case :D


12-07-2008, 11:24 PM
Don't know about the errors you received during an install, but according to you're PHP error, PHP is for certain installed.
Ports 80 and 443 are commonly used for web servers and SSL, so it sounds like you already have a webservice in use (if you're on windows xp PRO or above, you may have IIS running). You can use a PHPinfo page to check this:


It should tell you what you're server software is.

As for you're mysql problem, it looks like you can't connect to a remote host. You'll need to check with the remote host its possible that mysql needs specific port or socket information in order to connect. This will happen if they've chosen a different port than the default 3306. It is also possible that you're firewall is preventing you from the remote connection.

12-25-2008, 10:22 AM
The problem is that Xampp doesn't install or uninstall the services correctly in Windows.

To correct it, uninstall Xampp- again.

Open your services panel by typing in 'services.msc' in the windows Run box ( windows symbol + R)

Double click the services to get the actual service name as its different than the shown display name. For Xampp 1.7 Apache 2.2 is Apache2.2, Xampp Controler is XAMPP, and MySQL is mysql. You may have a different version of Xampp so I included all the steps.

Now open a CMD box. ( windows symbol + R then type CMD.)
Type in "sc delete <service name>" for all 3 services. Reboot. Now you can install Xampp again without any problems.

01-12-2009, 12:21 AM
Thank you Action_Bastrd. That did the trick.

03-04-2009, 08:51 PM
I was having the same problem and your solution worked thanks again:thumbsup:

04-16-2009, 05:11 PM
Totally new to XAMPP (installed yesterday on my laptop) & finally worked through getting all the ports open in the McAfee firewall. Everything seems to be running except that now MySQL won't start.

I'm not running services (because I am not sure what they provide.)

Any help would be greatly appreciated !

05-18-2012, 10:37 AM
I am trying to install testlink 1.8.5.
In xammp control panel application apache and mysql is running...
but in services its not showing the both service .
what could be the problem.
Please suggest me any solutions

apache problem:
Installing Apache2.2 as an Service
The system cannot find the path specified.
Now we Start Apache2.2
The service name is invalid.

More help is available by typing NET HELPMSG 2185.

Press any key to continue . . .

MySQL problem:
Installing MySQL as an Service
The system cannot find the path specified.
The system cannot find the path specified.
Try to start the MySQL deamon as service ...
The service name is invalid.

More help is available by typing NET HELPMSG 2185.

Press any key to continue . . .