gpt4 book ai didi

mysql - Windows 7 PHP MySQL 连接问题

转载 作者:可可西里 更新时间:2023-11-01 07:17:11 24 4
gpt4 key购买 nike

<分区>

当我运行 $conn = mysql_connect($host, $user, $pass); 时,我能够连接到数据库,但是当我执行 var_dump($conn ) 我返回 bool(true) 这限制了我与多个服务器建立多个连接。

这台计算机上的原始设置是 XAMPP,其 PHP 5.2 版本已通过 PHP 安装程序升级到 PHP 5.3.4。它可以毫无问题地连接到其本地数据库(除了返回一个 bool 值而不是资源链接标识符)但无法连接到任何远程机器(并且连接到远程机器的能力已经得到确认)。由于无法提出解决方案,我升级到内置 PHP 5.3.1 的 XAMPP 版本。重新安装 XAMPP 后我得到完全相同的错误,这让我相信这是一个更大的问题.

编辑 1 **

移动到全新安装的 Windows 并安装 XAMPP 并尝试运行 mysql_connect 到远程服务器 (PHP 5.3.1) 我得到同样的错误:

Warning: mysql_connect() [function.mysql-connect]: Premature end of data (mysqlnd_wireprotocol.c:554) in [Removed] on line 2

Warning: mysql_connect() [function.mysql-connect]: OK packet 1 bytes shorter than expected in [Removed]p on line 2

Warning: mysql_connect() [function.mysql-connect]: mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication. Please use an administration tool to reset your password with the command SET PASSWORD = PASSWORD('your_existing_password'). This will store a new, and more secure, hash value in mysql.user. If this user is used in other scripts executed by PHP 5.2 or earlier you might need to remove the old-passwords flag from your my.cnf file in [Removed] on line 2

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