Jump to content

Recommended Posts

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!"

then

"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

 

Batric

Link to comment
https://forums.phpfreaks.com/topic/135933-xampp-mysql-problem/
Share on other sites

"Ports 80 or 443 (SSL) already in use! Installing Apache2-2 service failed!"

then

"Port 3306 already in use! Installing MySQL service failed!

The error message are pretty straight forward. Apache and MySQL have failed to start as the port 80/3306 are both being used.

 

Port 80 is used by Apache

Port 3306 is used by MySQL.

 

Before starting Apache/MYSQL via XAMPP make sure nothing is running on port 80 or port 3306. Ports can only be used by one process at a time.

 

 

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)"

 

If you're trying to connect to your local MySQL installation, then you'll need to use localhost instead of mysql2.namesco.net as the hostname -- this will be defined in your PHP script (I presume dbc.php)

Link to comment
https://forums.phpfreaks.com/topic/135933-xampp-mysql-problem/#findComment-709595
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.