I've been trying to connect to a remote DB hosted elsewhere, not my my PC as localhost, but whenever I do (using the exact same password, host, etc as the live server), I get these errors:
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').
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 C:\xampp\htdocs\Test\auth.php on line 12
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.
开发者_StackOverflow 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
What am I doing wrong?
Edit: I still can't get it, I did try updating xampp.
Edit:
SELECT Length( PASSWORD( 'xyz' ) )
This returned 41 on my localhost and 16 on the server, so I added old_passwords=1 in my.cnf, restarted mysql so now they both equal 16. Same errors still.
Edit: Still clueless, it works for other people but not me...
Edit: Tried googling it, tried a few fixes; none worked.
Down-grade to xampp 1.6.7 (from 1.7.4) Worked for me!
精彩评论