nefo_x
nefo_x

Reputation: 3088

IIS + PHP + MySQL: A connection attempt failed because the connected party did not (trying to connect via tcp://localhost:3306)

I'm running Windows, having installed IIS 7.5, PHP 5.3 (FastCGI). Trying to connect to MySQL and getting an error "A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.".

Started to develop a project with XAMPP, but had the requirement to move it to IIS (because of AD auth). MySQL is running from XAMPP stack. I've mapped IIS to the same docroot as Apache2's, but to another port. When accessing test page server with Apache2 host - there is no problem, but when accessing IIS + PHP FCGI page - I get this error.

Upvotes: 2

Views: 3489

Answers (2)

ravi ranjan
ravi ranjan

Reputation: 143

try using "127.0.0.1" instead of "localhost" as MySQL host. Just saved my life XD XD XD

Upvotes: 0

Levon Mirzoyan
Levon Mirzoyan

Reputation: 461

In your script, try using "127.0.0.1" instead of "localhost" as MySQL host.

If this solves your problem you can add the following line to your hosts file in /Windows/System32/drivers/etc/hosts:

127.0.0.1 localhost

After that you will able to use "localhost".

Upvotes: 6

Related Questions