doushangxianq07480
2014-11-12 23:08
浏览 62
已采纳

通过PHP从GoDaddy连接到远程AWS MySQL

I'm having an issue connecting to a remote MySQL server that is hosted by Amazon Web Services. I can connect to this MySQL server from virtually any other computer, but for some reason I cannot get it to be pulled into my PHP that is hosted on GoDaddy.

Here is the PHP code:

$cxn = mysql_connect($host,$user,$passwd,$dbname)
         or die("Query died: Cannot connect.");

I've added the host name for the MySQL server into GoDaddy's CPANEL > Remote MySQL Access Hosts. I know that the variables are correct, because I've tested this on another server and everything works fine.

I've been on the phone with GoDaddy twice now, and all they've said is to try asking a forum (apart from adding the MySQL host to the Remote Access Hosts page).

I've checked the security group for the AWS MySQL and made sure that it is open to the GoDaddy's hosted IP address...

I'm just not sure what else to do! Why isn't this working on GoDaddy's server when it was working just fine on another??

MySQL v5.6 --> on AWS PHP v5.4 --> on GoDaddy

图片转代码服务由CSDN问答提供 功能建议

我在连接到由Amazon Web Services托管的远程MySQL服务器时遇到问题。 我可以从几乎任何其他计算机连接到这个MySQL服务器,但由于某种原因,我无法将它拉入我在GoDaddy上托管的PHP。</ p>

这是PHP代码: </ p>

  $ cxn = mysql_connect($ host,$ user,$ passwd,$ dbname)
或die(“查询死亡:无法连接。”); 
 </  code> </ pre> 
 
 

我已将MySQL服务器的主机名添加到GoDaddy的CPANEL&gt; 远程MySQL访问主机。 我知道变量是正确的,因为我已经在另一台服务器上测试了这一切,一切正常。</ p>

我现在已经和GoDaddy通电了两次了,他们都是 说是尝试询问论坛(除了将MySQL主机添加到远程访问主机页面)。</ p>

我已经检查了AWS MySQL的安全组,并确保它是 打开GoDaddy的托管IP地址...... </ p>

我不知道还能做什么! 为什么GoDaddy的服务器在另一台服务器上正常工作时不能正常工作?</ p>

MySQL v5.6 - &gt; 在AWS PHP v5.4上 - &gt; 在GoDaddy </ p> </ div>

1条回答 默认 最新

相关推荐 更多相似问题