On 3 Sep 2002 at 23:00, Bryan McLemore wrote:

> ----- Original Message -----
> From: "David Robley" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, September 03, 2002 9:31 PM
> Subject: [PHP-DB] Re: mysql_connect
> 
> 
> > In article <000c01c253b2$506d7530$0101a8c0@fwcmain>,
> > [EMAIL PROTECTED] says...
> > > I'm trying to connect using the sample code in the php documentation.
> IT however dies every time.  If someone could please help me?  Thanks. > >
> > > Bryan > > > Can you show the code you are using, and any error
> messages you get? > > -- > David Robley > Temporary Kiwi! > > Quod subigo
> farinam > > -- > PHP Database Mailing List (http://www.php.net/) > To
> unsubscribe, visit: http://www.php.net/unsub.php >

Love the formatting by your mail pkg - OE of course :-)

> The code is
> 
> $link = mysql_connect("localhost:3306", "UserName", "Password")
>              or die("Could not connect");
> 
> Thanks,
> Bryan McLemore

May I suggest you keep the discussion on the mailing list - a) you have 
the entire list's expertise to draw on, b) the solution is shared with 
others who may benefit and c) you may get a quicker answer.

Now, you haven't said so, but I assume you are getting 'Could not 
connect'?

So, points to check:

1) mysql is running, and on port 3306; note that you don't need to 
specify the port usually
2) the username and password are correct - try the command line version 
to check that the user/pass are accepted (assuming you have command line 
access)
3) remove the 'or die' construct and see if you get an error message


-- 
David Robley
Temporary Kiwi!
Quod subigo farinam

"My grape juice has fermented," Tom whined.



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to