Re: ERROR 2003 (HY000) Can't connect to MySQL server on 'localhost' (10061)
L RLJ Wrote:
-------------------------------------------------------
> Hi, I can't seem to connect to MySQL via PHP. I
> get the following error message when I try:
>
> --------------------------------------------------
> --------------------------------
> Warning: mysql_connect(): [2002] A connection
> attempt failed because the connected party did not
> (trying to connect via tcp://localhost:3306) in
> C:\Program Files (x86)\Apache Software
> Foundation\Apache2.2\htdocs\mysqlconnect.php on
> line 3 Warning: mysql_connect(): 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. in C:\Program Files
> (x86)\Apache Software
> Foundation\Apache2.2\htdocs\mysqlconnect.php on
> line 3 Fatal error: Maximum execution time of 30
> seconds exceeded in C:\Program Files (x86)\Apache
> Software
> Foundation\Apache2.2\htdocs\mysqlconnect.php on
> line 3
> --------------------------------------------------
> --------------------------------
>
> I am running windows 7 with Apache 2.2, PHP 5.3
> and MySQL server 5.1. In task manager,
> ApacheMonitor is running under processes and
> Apache is running under services. MySQL is listed
> under services, but is stopped. When I try to
> access MySQL via the command line I get the
> following error message:
>
> ERROR 2003 (HY000) Can't connect to MySQL server
> on 'localhost' (10061)
>
> So it would seem I have installed/configured
> Apache/MySQL wrong. Could anyone please tell me
> what I should check for? e.g. is there a setting
> in one of the .ini files that I should change?
>
> P.S. when I first installed MySQL I could access
> it via the command line fine, but I still couldn't
> connect via PHP. Not being able to access it via
> command line is a recent development.
Subject
Written By
Posted
September 28, 2010 06:27AM
September 28, 2010 11:16AM
Re: ERROR 2003 (HY000) Can't connect to MySQL server on 'localhost' (10061)
October 08, 2010 03:16PM
February 03, 2011 04:52AM
November 08, 2010 11:06AM
February 24, 2011 09:14PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.