データベースサーバーとアプリケーションサーバーがあり、PHPを使用してアプリケーションサーバーをリモートデータベースサーバーに接続しようとしています。
いつものように、私は次のようにそれを使用しました。
<?php
mysql_connect("remotedb.com", "mysqladmin", "mysqlpassword") or die(mysql_error());
echo "Connected to MySQL<br />";
?>
しかし、このテストを実行しようとすると、次のエラーが発生します。
Warning: mysql_connect() [function.mysql-connect]: Host 'gator418.hostgator.com' is not allowed to connect to this MySQL server in /home/username/public_html/testmysql.php on line 2
Host 'gator418.hostgator.com' is not allowed to connect to this MySQL server
ドメインを%www.myappserver.com%としてリモートサーバーのcpanel "Remote MySQL"に追加しましたが、それでも問題は解決しません。なぜこのエラーが発生するのか誰かに教えてもらえますか?