MySQL Question

Access denied for Database User at goDaddy website

I am trying to view my website from godaddy. The domain name is registered on somewhere else and hosting is from godaddy. After changing DNS settings, I cretae my db in godaddy and import all tables in it. After that, i created a username and give it to all previleges. Then, when i tried to connect to database, i am facing error

Access denied for user 'myusername'@'ip-166-62-28-82.ip.secureserver.net' (using password: YES)


db.php

<?php

$conn = mysql_connect("166.62.28.82", "myusername","mypassword", "arikai2_2" ) or die(mysql_error());

mysql_select_db("arikai2_2");

?>

Answer

Where did you get the dbhost value from?

In your hosting panel, there should be somewhere a section where you can get the right details about connecting to your database server and its databases.

If you are using the classic goDaddy hosting, you can find this info in the:
Databases > MySQL Section > Actions > Details
The dbhost is down at the bottom of this screen: Hostname

GoDaddy Classic Hosting Panel GoDaddy Classic Hosting Databases GoDaddy Classic Hosting Database Details