Jump to content

Recommended Posts

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 by ajetrumpet
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.

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?

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.

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.

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 by ajetrumpet
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.

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.