-
Junior Member
hostname for mysql if webpage is not hosted by host1free
Hi
What should be the hostname for mysql if the webpage is hosted somewhere else? I believe "localhost" is only useful if the webpage is hosted in host1free.
Thanks.
-
Super Moderator
Re: hostname for mysql if webpage is not hosted by host1free
Hello,
Hostname should be server IP. For example, box6 IP will be 94.249.139.3.
-
Junior Member
Re: hostname for mysql if webpage is not hosted by host1free
Hi,
I am still unable to connect with the IP address.
<html>
<body>
<?php
$con = mysql_connect('94.249.139.6', 'ahbert_test', '4test4test');
if (!$con)
{
$txt="Die loh";
echo "<p>$txt</p>";
die('Could not connect: ' . mysql_error());
}
?>
</body>
</html>
Above is returning
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'ahbert_test'@'gator276.hostgator.com' (using password: YES) in /home/timyeo/public_html/wcheng/testdb.php on line 6
Die loh
Could not connect: Access denied for user 'ahbert_test'@'gator276.hostgator.com' (using password: YES)
-
Super Moderator
Re: hostname for mysql if webpage is not hosted by host1free
Probably you also need to remote hostname from which you are trying to connect. Assuming you are connecting from hostgator, it will be hostgator server IP where your website is hosted. To add remote hostname, go to MySQL Management and click on your database name. Under Access Hosts type in hostgator server IP and click Add Host. That should help.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules