vozzek Posted December 20, 2007 Share Posted December 20, 2007 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! Quote Link to comment https://forums.phpfreaks.com/topic/82549-access-denied-using-password-yes/ Share on other sites More sharing options...
fenway Posted December 20, 2007 Share Posted December 20, 2007 Yes, it was an IP issue. No, you can't safely assume anything. Try issuing a "SELECT NOW()" using an actual php function, not some fancy wrapper class. Quote Link to comment https://forums.phpfreaks.com/topic/82549-access-denied-using-password-yes/#findComment-419696 Share on other sites More sharing options...
vozzek Posted December 20, 2007 Author Share Posted December 20, 2007 Fenway, thanks for the reply... but I'm not sure what you mean by wrapper class. Quote Link to comment https://forums.phpfreaks.com/topic/82549-access-denied-using-password-yes/#findComment-419706 Share on other sites More sharing options...
fenway Posted December 21, 2007 Share Posted December 21, 2007 dbQuery() isn't php. Quote Link to comment https://forums.phpfreaks.com/topic/82549-access-denied-using-password-yes/#findComment-420212 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.