从Heroku外部连接到cPanel服务器上的MySQL数据库?

从Heroku外部连接到cPanel服务器上的MySQL数据库?

问题描述:

I am using the Heroku app to host a facebook application since Facebook is changing how they have their applications set up, again. However I need to connect to the MySQL Externally from my cPanel VPS and I am not able to connect correctly. I have tried using the darkprospect.net(host domain), ultimate-battle-online.com (primary domain of user) and 184.154.20.170 as well as those plus the combination of added port 3306 and none have worked. I previously needed to make sure that I added the right domain to the right file but right now it's just not connecting. Right now get this error when using mysql_connect() function:

Lost connection to MySQL server at 'reading initial communication packet', system error: 110

Again, thank you for any ideas that you may have!

EDIT: I found out that it was an issue with the buildpack that is the default for PHP apps, since I develop on a VPS with PHP 5.4.7 I was using parameters that were tuned for it and were not very supportive on their bundle of vanilla PHP and Apache.

我正在使用Heroku应用程序来托管Facebook应用程序,因为Facebook正在改变他们的应用程序设置方式, 。 但是我需要从我的cPanel VPS外部连接到MySQL,我无法正确连接。 我尝试使用 darkprospect.net code>(主机域), ultimate-battle-online.com code>(用户的主域)和 184.154.20.170 code >以及那些加上端口 3306 code>的组合,没有一个有效。 我之前需要确保将正确的域添加到正确的文件中,但现在它只是没有连接。 现在使用 mysql_connect() code>函数时出现此错误: p>

 在“读取初始通信数据包”时丢失与MySQL服务器的连接,系统错误:110  
  code>  pre> 
 
 

再次感谢您提出的任何想法! p>

编辑 strong>:我 发现这是buildpack的一个问题,这是PHP应用程序的默认设置,因为我使用PHP 5.4.7开发VPS我使用的是针对它调整的参数,并且对它们的vanilla PHP和它们的捆绑不太支持 Apache。 p> div>

I was able to create a new Heroku buildpack that was able to support all of the features that my application was needing. Because I was developing on my VPS in PHP 5.4.7 my configurations were designed for more of the new features and with the Heroku's basic Buildpack only having PHP 5.3.10 there were unseen errors in background logs that were halting the connection process. Additionally CSF Firewall was configured only for UDP income 3306 and I was able to add it to UTP as well and that seemed to resolve the Connection Timed Out error that was the final error after I made a better buildpack for myself.