You are here: Re: mysql_connect problem « PHP SQL « IT news, forums, messages
Re: mysql_connect problem

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация