| 
	
 | 
 Posted by greasydan on 07/25/06 11:41 
Richard Hulbert wrote: 
 
> Have you ever connected to this DB? When you connect to mySQL it checks 
> to see where the request is comming from. lets say that your mySQL 
> server is on the same machine as your php pages that are trying to 
> connect to it. SERVER = localhost or 127.0.0.1 if your connection has 
> those privelliges then all well and good you can connect however if you 
> try to connect to the same server from another machine the you will get 
> rejected. you can make as many connections as you like so you could 
> make another connection for that machine that specifies that it is 
> comming form another machine. 
> 
> Richard 
 
Hi Richard, 
 
I am able to connect from the command line to the db on the windows 
box, just not via mysql_connect() on the php pages. 
 
eg: 
 
mysql --host=SERVER -u USER -p 
works like a dream 
 
BUT 
 
$db = mysql_connect("SERVER", "USER", "PASSWORD") 
                or die("Could not connect to database: 
".mysql_error()); 
 
gives me: 
 
Could not connect to database: Can't connect to MySQL server on 
'SERVER' (13)  
 
Cheers 
Dan
 
  
Navigation:
[Reply to this message] 
 |