MySQL Forums :: PHP :: unable to connect to mysql on localhost


Advanced Search

unable to connect to mysql on localhost
Posted by: Patrick van Zandbeek ()
Date: November 12, 2006 04:54AM

Hi,

I just installed Apache2, php5 and mysql5 on win xp pro. Everything works fine, php works nicely and mysql shows up in phpinfo().
Connecting to mysql from the console works fine too, however when I try to do

<?

$link = mysql_connect('localhost','root', 'my_password');

?>

I get an error saying: Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'localhost' (10061) in C:\Apache2\htdocs\mysql.php on line 3.

Anything wrong with my connection attempt, I use the same password I use when logging into MySql via the console??

I also tried downloading and installing the latest mysql connector files but that didn't solve it either.

Thanks



Edited 1 time(s). Last edit at 11/12/2006 04:55AM by Patrick van Zandbeek.

Options: ReplyQuote


Subject Written By Posted
unable to connect to mysql on localhost Patrick van Zandbeek 11/12/2006 04:54AM
Re: unable to connect to mysql on localhost Bob Field 11/12/2006 09:12AM
Re: unable to connect to mysql on localhost Alice Law 11/13/2006 11:30PM
Re: unable to connect to mysql on localhost Scott Miller 11/14/2006 12:17AM
Re: unable to connect to mysql on localhost, OS used WINDOWS XP Guruprasad Chube 04/30/2007 09:52PM
Re: unable to connect to mysql on localhost, OS used WINDOWS XP sam v 06/06/2007 09:57AM
Re: unable to connect to mysql on localhost, OS used WINDOWS XP steve cordingley 06/06/2007 10:04AM
Re: unable to connect to mysql on localhost Imran Nazir 06/28/2007 12:01AM
Re: unable to connect to mysql on localhost sanjeev thakur 02/19/2009 12:15AM


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.