title: Localhost (using xampp) connecting to a remote DB?
body: <p>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:</p>
  
  <pre><code>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').
  </code></pre>
  
  <blockquote>
    <p>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</p>
  </blockquote>
  
  <pre><code>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
  </code></pre>
  
  <p>What am I doing wrong?</p>
  
  <p>Edit: I still can't get it, I did try updating xampp.</p>
  
  <p>Edit: </p>
  
  <pre><code>SELECT Length( PASSWORD( 'xyz' ) ) 
  </code></pre>
  
  <p>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.</p>
  
  <p>Edit: Still clueless, it works for other people but not me...</p>
  
  <p>Edit: Tried googling it, tried a few fixes; none worked.</p>