RE: mysql_connect

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Guess that would have been helpful.

Warning: mysql_connect(): Access denied for user:
'username@xxxxxxxxxxxxxxxxx' (Using password: YES) in
/home/virtual/site2/fst/var/www/html/test/global.php on line 74
Couldn't connect to server.

-----Original Message-----
From: Jason Wong [mailto:php-general@xxxxxxxxxxxx]
Sent: Thursday, November 04, 2004 7:47 AM
To: php-general@xxxxxxxxxxxxx
Subject: Re:  mysql_connect


On Thursday 04 November 2004 06:22, Ben Miller wrote:
> I am having trouble connecting to a database on another server.  I have
the
> following for the connection, but it seems to be overriding the value for
> the $host variable, and replacing it with localhost.  Anyone got any
ideas?
>
>  $host="domain.com";
>  $user="username";
>  $password="password";
>  $database="dbname";
>  $connection = mysql_connect($host,$user,$password)
>   or die ("Couldn't connect to server.");
>  $db = mysql_select_db($database,$connection)
>   or die ("Couldn't select database.");

What does mysql_error() say?

--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
The man on tops walks a lonely street; the "chain" of command is often a
noose.
*/

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

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux