1

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

  • What version of MySQL is running on the server? (`select version()`) – Marc B Oct 16 '11 at 04:49
  • Remote server: 5.1.51-community-log On a side note, how do you change phpmyadmin's language? localhost phpmyadmin is in german, I believe. –  Oct 16 '11 at 05:10
  • http://stackoverflow.com/questions/1575807/cannot-connect-to-mysql-4-1-using-old-authentication/2901706#2901706 – Roman Feb 17 '12 at 23:57
  • Is it possible to a remote host "see" a local host ? I have the same situation here, and I see no solution to this case unless your local serve is visible in the internet just like the remote server is. How could you reach the IP 127.0.0.1 or localhost from the outside? – devasia2112 Oct 05 '12 at 21:26
  • No, @B4NZ41 your xampp cannot be connected to remotely unless you're running some other hosting software –  Oct 06 '12 at 02:40

1 Answers1

0

Down-grade to xampp 1.6.7 (from 1.7.4) Worked for me!

TKMAX
  • 16