无法连接到 phpBB 中的 MySQL 数据库

发布于 2024-09-12 11:17:56 字数 702 浏览 7 评论 0原文

我正在尝试使用 mysql_connect() 命令连接到 MySQL 数据库,但是我不断收到错误消息:

警告:mysql_connect() [function.mysql-connect]: [2002] 连接尝试失败,因为连接方没有(尝试通过第 12 行 C:\Data\GITA\Web Design\Projects\Ravenwolf\LoginTest.php 中的 tcp://ravenwolftest.db.4292619.hostedresource.com:3306 进行连接

警告:mysql_connect() [function.mysql -connect]:连接尝试失败,因为连接方在一段时间后没有正确响应,或者由于连接的主机未能响应而建立的连接失败。在第 12 行的 C:\Data\GITA\Web Design\Projects\Ravenwolf\LoginTest.php 中,

我在 phpBB 文件夹中搜索,发现在 config.php 文件夹中列出了主机名、用户名和密码。我将它们放入 mysql_connect() 行但得到相同的错误。我还使用 godaddy.com 进行网络托管,以防万一。至于代码本身,我所拥有的只是:

mysql_connect('ravenwolftest.db.4292619.hostedresource.com','ravenwolftest','password');

提前感谢您的帮助。

I am trying to connect to a MySQL database using the mysql_connect() command however I keep getting the error message:

Warning: mysql_connect() [function.mysql-connect]: [2002] A connection attempt failed because the connected party did not (trying to connect via tcp://ravenwolftest.db.4292619.hostedresource.com:3306) in C:\Data\GITA\Web Design\Projects\Ravenwolf\LoginTest.php on line 12

Warning: mysql_connect() [function.mysql-connect]: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. in C:\Data\GITA\Web Design\Projects\Ravenwolf\LoginTest.php on line 12

I searched around in the phpBB folder and found in the config.php folder there was listed a host name, username, and password. I put those into the mysql_connect() line but get the same error. I am also using godaddy.com for web hosting in case that means anything. As for the code itself all I have is:

mysql_connect('ravenwolftest.db.4292619.hostedresource.com','ravenwolftest','password');

Thanks in advance for any help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

乄_柒ぐ汐 2024-09-19 11:17:56

似乎其他服务器已关闭或不允许外部连接到数据库。
我建议您在 Godaddy 控制面板中启用外部访问

it seems that either the other server is down or does not allow external connections to the database.
i would suggest that you enable external access in your godaddy control panel

我也只是我 2024-09-19 11:17:56

您是否控制机器ravenwolftest.db.4292619.hostedresource.com? MySQL 是否在其上运行?如果不是您的本地计算机,您是否已验证 MySQL 是否允许来自您的计算机的连接?

Do you control the machine ravenwolftest.db.4292619.hostedresource.com? Is MySQL running on it? If it's not your local machine, have you verified that MySQL is permitting connections from your machine?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文