Reputation: 454
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");
?>
Upvotes: 3
Views: 5589
Reputation: 1112
Anyone having issue even after correct username,password and database name, reset your database user's password and update it in your mysqli connection code. This is weird but it worked for me.
Upvotes: 0
Reputation: 988
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
Upvotes: 4
Reputation: 21
Make sure that the mysql host is correct. You can contact your hosting provider to help you getting the proper host for your connection string.
Upvotes: 2