ajetrumpet Posted October 13, 2019 Author Share Posted October 13, 2019 (edited) hmmm...I've been working on this a little too long I think. No more parse error, but it is still denying my credentials: [13-Oct-2019 20:52:27 UTC] PHP Fatal error: Uncaught exception 'mysqli_sql_exception' with message 'Access denied for user 'username'@'ip-ipaddress.ip.secureserver.net' (using password: YES)' in /home/name/public_html/DOMAIN/test/recordpageview.php:14 Stack trace: #0 /home/name/public_html/DOMAIN/test/recordpageview.php(14): mysqli->mysqli('ipaddress, 'username', 'password', 'rptDatabase') #1 {main} thrown in /home/name/public_html/DOMAIN/test/recordpageview.php on line 14 I will contact GoDaddy and see what the issue is. Edited October 13, 2019 by ajetrumpet Quote Link to comment Share on other sites More sharing options...
Barand Posted October 13, 2019 Share Posted October 13, 2019 1 hour ago, ajetrumpet said: I added my username to the database as an authorized user and clicked "allow all privaleges". Be careful what privileges you give to an online connection. Just give the bare minimum required for the site to function. Quote Link to comment Share on other sites More sharing options...
ajetrumpet Posted October 13, 2019 Author Share Posted October 13, 2019 well this is just a test script. when I implement this to work fulltime I will look into that more closely. r u saying one should not have full privaleges even if they are the site owner / admin? Quote Link to comment Share on other sites More sharing options...
ajetrumpet Posted October 13, 2019 Author Share Posted October 13, 2019 Berand, I just finished with godaddy and they pretty much pissed me off. I have tried this with "ipaddress" in the $dbHost variable and "www.domainname.com" in it as well. I've also tried my own username and password with both those options for $dbHost as well as tried the actual server's "username" and "password" for those variables as well. everything i've tried results in the same damn error. and godaddy claims everything is fine on their end. what do you think? Quote Link to comment Share on other sites More sharing options...
Barand Posted October 13, 2019 Share Posted October 13, 2019 I have yet to meet the developer who's happy with GoDaddy. You are trying to connect to a MySQL database on GoDaddy's server, so the host is their server's server name or IP address. The username and password also need to be valid for access to that database on that server. Can you connect to the database using PhpMyAdmin? If so that's a good place to start with the right credentials. Quote Link to comment Share on other sites More sharing options...
ajetrumpet Posted October 13, 2019 Author Share Posted October 13, 2019 yes i have access to phpMyAdmin. the agent even created a user for rptDatabase and a password and she ran a script she got from a higher level agent and she claims she was able to connect. she could not see the script code though, so she couldn't tell me what her connection string looked like. the only 2 things she did differently than me was use "localhost" for $dbHost variable and she also included a port number in the connection string arguments, but the port is optional. I got the username and password that she used from her and tried to use on my script and got the same damn error. Quote Link to comment Share on other sites More sharing options...
ajetrumpet Posted October 13, 2019 Author Share Posted October 13, 2019 (edited) SOLVED: $dbHost apparently has to be "localhost". now why in the hell is that the case!? have you ever heard of this? that does not seem right at all. it should be an ip address or domain name, shouldn't it? Look I really appreciate you sticking with me through this. and for your script. I will make an effort to become a little more educated in PHP. Edited October 13, 2019 by ajetrumpet Quote Link to comment Share on other sites More sharing options...
maxxd Posted October 14, 2019 Share Posted October 14, 2019 2 hours ago, ajetrumpet said: $dbHost apparently has to be "localhost". now why in the hell is that the case!? Because the database server is on the same machine as the web server. 2 hours ago, ajetrumpet said: have you ever heard of this? All the time, actually. 2 hours ago, ajetrumpet said: it should be an ip address or domain name, shouldn't it? If you feel strongly about using an IP address you can try http://127.0.0.1 and that should work - although honestly, it's GoDaddy so I can't guarantee it. Quote Link to comment 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.