无法连接到 phpBB 中的 MySQL 数据库
我正在尝试使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
似乎其他服务器已关闭或不允许外部连接到数据库。
我建议您在 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
您是否控制机器
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?