1

我一直在尝试连接到托管在其他地方的远程数据库,而不是我的 PC 作为本地主机,但是每当我这样做(使用与实时服务器完全相同的密码、主机等)时,我都会收到以下错误:

Warning: mysql_connect() [function.mysql-connect]: Premature end of data 
(mysqlnd_wireprotocol.c:553) in C:\xampp\htdocs\Test\auth.php on line 12

Warning: mysql_connect() [function.mysql-connect]: OK packet 1 bytes shorter 
         than expected in C:\xampp\htdocs\Test\auth.php on line 12

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').

这将在 mysql.user 中存储一个新的、更安全的哈希值。如果此用户在 PHP 5.2 或更早版本执行的其他脚本中使用,您可能需要从第 12 行 C:\xampp\htdocs\Test\auth.php 中的 my.cnf 文件中删除 old-passwords 标志

Could not connect to host: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

我究竟做错了什么?

编辑:我仍然无法得到它,我确实尝试更新 xampp。

编辑:

SELECT Length( PASSWORD( 'xyz' ) ) 

这在我的本地主机上返回 41,在服务器上返回 16,所以我在 my.cnf 中添加了 old_passwords=1,重新启动了 mysql,所以现在它们都等于 16。仍然存在相同的错误。

编辑:仍然一无所知,它适用于其他人,但不适用于我......

编辑:尝试谷歌搜索,尝试了一些修复;没有工作。

4

1 回答 1

0

降级到 xampp 1.6.7(从 1.7.4)为我工作!

于 2011-11-21T15:10:36.307 回答