gpt4 book ai didi

php - 在 'reading initial communication packet' 处丢失与 MySQL 服务器的连接,系统错误 : 0

转载 作者:IT老高 更新时间:2023-10-28 11:48:28 26 4
gpt4 key购买 nike

我收到错误:

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

当我要连接我的数据库时。

如果我使用 localhost 一切正常。但是当我使用如下所示的实时 IP 地址时,会出现错误:

mysql_connect("202.131.xxx.106:xxxx", "xxxx", "xxxxx") or die(mysql_error());

最佳答案

某人 here表明这可能是防火墙问题:

I have just had this problem and found it was my firewall. I use PCTools Firewall Plus and it wasn't allowing full access to MySQL. Once I changed that it was fine. Hope that helps.

可以吗?

另外,有人 here表明这可能是因为 MySQL 服务器绑定(bind)到环回 IP(127.0.0.1/localhost),这有效地切断了您从“外部”连接。

如果是这种情况,您需要将脚本上传到网络服务器(可能也在运行 MySQL 服务器)并将您的服务器主机保持为“localhost”

关于php - 在 'reading initial communication packet' 处丢失与 MySQL 服务器的连接,系统错误 : 0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5755819/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com