467,136 Members | 1,254 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,136 developers. It's quick & easy.

Access Denied (using password 'YES')

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:

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. $hostname_TFATP = 'mywebsite.com';  // (used to be localhost)
  3. $database_TFATP = 'mydatabase_TFATP';
  4. $username_TFATP = 'mydatabase_danny';
  5. $password_TFATP = 'christmas123';
  6. $TFATP = mysql_pconnect($hostname_TFATP, $username_TFATP, $password_TFATP) or trigger_error(mysql_error(),E_USER_ERROR); 
  7. ?>
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:

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. line 20        require_once('../../Connections/TFATP_paypal.php');
  3. line 21
  4. line 22          // check that the invoice has not been previously processed
  5. line 23         $sql = "SELECT status
  6. line 24         FROM tbl_order
  7. line 25         WHERE order_id = {$_POST['invoice']}";
  8. line 26
  9. 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!
Dec 20 '07 #1
  • viewed: 1475
Share:

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by bruno | last post: by
reply views Thread by Ryan Schefke | last post: by
reply views Thread by Morten Gulbrandsen | last post: by
reply views Thread by Steve | last post: by
2 posts views Thread by Shailesh Gajare | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.