Jump to content

Access Denied (using password 'YES')


Recommended Posts

Hi all,

 

I've got a mySQL database I've been working with as my localhost for several months now, no connection problems.  I'm at the point however, where I need to connect to the database from another site / different IP address.

 

I'm playing around in the PayPal sandbox, and I'm running an instant payment notification php script before the user exits.  The included connection file looks like this:

 

<?php
$hostname_TFATP = 'mywebsite.com';  // (used to be localhost)
$database_TFATP = 'mydatabase_TFATP';
$username_TFATP = 'mydatabase_danny';
$password_TFATP = 'christmas123';
$TFATP = mysql_pconnect($hostname_TFATP, $username_TFATP, $password_TFATP) or trigger_error(mysql_error(),E_USER_ERROR); 
?>

 

So far so good, right?  My ipn.php script runs fine until it gets to the point where it needs to connect to my database.  Then, in the error log, I see the following:

PHP Warning:  mysql_pconnect() [<a href='function.mysql-pconnect'>function.mysql-pconnect</a>]: Access denied for user 'mydatabase_danny'@'gator306.hostgator.com' (using password: YES) in /home/mydatabase/public_html/Connections/TFATP_paypal.php on line 9

 

So I read up on this.  I find out I need to allow the host access to my database, so I go into the ACCESS HOSTS portion of the mySQL account maintenance and I add the following address:  66.135.197.%  All PayPal addresses start with 66.135.197 and I throw the wild card in at the end.  But I still get the error.

 

Someone suggested I make sure there was no 'bind' address in my mySQL config file, but I couldn't find that file.  So I called HostGator (my host) and asked them about it.  They assured me they don't use binds, so that was a dead end.

 

For giggles I decided to temporarily allow ALL addresses access to my database by entering all wildcards of %.%.%.% under the access hosts.  When I ran through the process this time, I got a different error:

 

[20-Dec-2007 11:38:21] PHP Fatal error:  Call to undefined function:  dbquery() in /home/mydatabase/public_html/include/paypal/ipn.php on line 27

 

The lines leading up to line 27 of that script look like this:

 

<?php
line 20        require_once('../../Connections/TFATP_paypal.php');
line 21
line 22          // check that the invoice has not been previously processed
line 23         $sql = "SELECT status
line 24         FROM tbl_order
line 25         WHERE order_id = {$_POST['invoice']}";
line 26
line 27         $result = dbQuery($sql);

?>

 

Does this mean it got past the connect part and blew up on the dbquery?  Can I safely assume it connected?

 

Can anyone offer up any other solution to my connection problem, other than wildcarding the entire world access to my database?  Because that's just not gonna fly.

 

Thanks in advance!

Link to comment
https://forums.phpfreaks.com/topic/82549-access-denied-using-password-yes/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.