"Donald Tyler" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > > I am publishing a site I have developed and I am having problems with > the scripts being able to access the remote MySQL server. When I try to > connect using the PHP scripts I just get an error saying that access is > denied. > > I can access it fine from my machine using PHPMyAdmin so I know that > remote access is being allowed.
PHPMyAdmin doesn't necessarily mean that remote access is allowed. A user in MySQL may be able to access the database from the localhost, but not from anywhere else. In your case it looks like you may have the same username defined twice, but with different levels of access. [EMAIL PROTECTED] access allowed to database Belvedere. [EMAIL PROTECTED] access not allowed to database Belvedere. Just a guess. > I have also connected to the web hosting server via SSH and have > connected successfully to the MySQL server via the MySQL client at the > terminal from that machine. So I know the server that the scripts are > running on also has access to the MySQL server. > > Here is my script. Please let me know if you have any ideas why this > would be happening: > > ----------------------------------------- > > <?PHP > > /*********************************************************************** > ************** > * Connects to a MySQL database using the Belvedere > account * > ************************************************************************ > *************/ > function DBMS_CONNECT() > { > global $Site_Settings; > > // Connect To DBMS > $Connection = mysql_connect($Site_Settings['DB_Host'], > $Site_Settings['DB_UserName'], $Site_Settings['DB_Password']) > or SQL_KillScript("Connecting to DBMS",$Connection); > > // Select DB > if (!mysql_select_db($Site_Settings['DB_Name'],$Connection)) > SQL_KillScript("Selecting Database",$Connection); > > // Return the connection variable > return $Connection; > } > > ?> > > ----------------------------------- > > Here is the error message: > > MySQL Error 1044 : Access denied for user: '[EMAIL PROTECTED]' to database > 'Belvedere' > > ----------------------------------- > > My DB_Host is specified as a domain name. e.g. db1.myhost.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php