mysql_connect() 未到达正确的服务器

发布于 2024-08-18 05:05:20 字数 686 浏览 2 评论 0原文

我有一个与本地服务器有全局开放的 mysql 连接的系统。在我的一个文件中,我打开了与远程计算机的附加连接。

我没有尝试连接到该机器,而是从 ISP 收到一条拒绝访问的消息(它似乎正在尝试连接到该机器上的数据库)。

我正在尝试使用以下方式进行连接:

$cust_conn = mysql_connect($host,'root','##password##');

我已尝试 subdomain.domain.com:3306 code>、subdomain.domain.comip:3306 作为 $host 的值。

奇怪的是,这是我得到的回应:

Warning: mysql_connect(): Access denied for user 'root'@'my.isp.com' (using password: YES) in /var/www/html/report/module/sql_view.php on line 19 Error: Could not connect to database:

有什么想法为什么会发生这种情况吗?似乎由于某种原因,我的脚本正在尝试连接到我的 ISP 服务器,而不是传入 $host 的服务器。

I have a system with a globally open mysql connection to the local server. In one of my files I am opening an additional connection to a remote machine.

Wieldly instead of trying to connect to that machine, I get an access denied message from my ISP (it seems to be trying to connect to the database on that machine).

I am trying to connect using:

$cust_conn = mysql_connect($host,'root','##password##');

I have tried subdomain.domain.com:3306, subdomain.domain.com and ip:3306 as the value for $host.

The wierd this is the response i get:

Warning: mysql_connect(): Access denied for user 'root'@'my.isp.com' (using password: YES) in /var/www/html/report/module/sql_view.php on line 19 Error: Could not connect to database:

Any ideas why this would happen? It seems like for some reason my script is attempting to connect to my ISPs server, instead of the one passed in $host.

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

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

发布评论

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

评论(2

み格子的夏天 2024-08-25 05:05:20

错误消息中给出的主机是它尝试连接的主机,而不是目标主机。

The host given in the error message is the host it's trying to connect from, not to.

猫烠⑼条掵仅有一顆心 2024-08-25 05:05:20

错误中的主机名 (my.isp.com) 是您客户端的主机...远程 root 访问通常被禁用,或者 pass/host 组合

添加凭据时可能是错误的:

http://dev.mysql.com/doc/refman/5.1/en/adding-users.html< /a>

that hostname in the error (my.isp.com) is your client's host...remote root access is often disabled, or perhaps the pass/host combo is wrong

to add the creds:

http://dev.mysql.com/doc/refman/5.1/en/adding-users.html

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