2

我有两个环境:

  • 开发: Windows 7、PHP 5.3.24、Apache 2.2.24
  • 生产: Linux、PHP 5.4.10、Apache

两者都连接到远程MySQL 5.5.24服务器。允许远程连接。

我将所有 mysql 函数替换为mysqli. 在生产中它连接正常,但在开发中通过以下错误:

Premature end of data (mysqlnd_wireprotocol.c:553)
OK packet 1 bytes shorter than expected
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

奇怪的是MySQL 是 5.5.24,而不是 4.1,并且old_passwords是 set Off。我什至更改了用户的密码(从主机面板,我没有管理员权限在 MySQL 本身中执行此操作)。

我什至尝试使用较新版本的 PHP (5.4.15),但问题仍然存在。

我读到的所有参考资料都指向过时的 MySQL 服务器(不是这种情况),old_password 问题(再次不是这种情况,因为它在生产中连接正常)。

更新:

mysql功能也不起作用。在将 mysql 更改为 mysqli 之前,我使用的是 PHP 5.2.* 版本,并且可以正常工作。所以我几乎可以肯定问题与 bundled 有关mysqlnd

4

0 回答 0