Localhost(使用xampp)连接到远程数据库?

时间:2011-10-07 08:30:28

标签: mysql passwords xampp localhost mysql-connect

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

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或更早版本执行的其他脚本   可能需要从my.cnf文件中删除旧密码标志   第12行的C:\ xampp \ htdocs \ Test \ auth.php

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

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

编辑:仍然无能为力,它适用于其他人但不适用于我......

编辑:尝试使用Google搜索,尝试了一些修复;没人工作。

1 个答案:

答案 0 :(得分:0)

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

相关问题