title: mysqlnd: Cannot connect to MySQL 5.5.24, old_passwords is Off
body: <p>I have two enviroments: </p>
  
  <ul>
  <li><strong>Dev:</strong> Windows 7, PHP 5.3.24, Apache 2.2.24</li>
  <li><strong>Production:</strong> Linux, PHP 5.4.10, Apache</li>
  </ul>
  
  <p>Both connects to a remote <code>MySQL 5.5.24</code> Server. Remote connections are allowed. </p>
  
  <p>I replaced all mysql functions to <code>mysqli</code>. In production it connects OK, but in dev throughs the following errors:</p>
  
  <pre><code>Premature end of data (mysqlnd_wireprotocol.c:553)
  OK packet 1 bytes shorter than expected
  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>The weird thing that the <strong>MySQL is 5.5.24, not 4.1</strong>, and <code>old_passwords</code> is set <code>Off</code>. I even changed user's password (from hosting panel, I have no admin privileges to do it in MySQL itself). </p>
  
  <p>I even tried with a newer version of PHP (5.4.15), and the problem persists. </p>
  
  <p>All references I read points to outdated MySQL Server (not this case), old_password issue (again not this case because it connects OK on production). </p>
  
  <p><em>UPDATE:</em></p>
  
  <p>Old <code>mysql</code> functions don't work neither. Before changing mysql to mysqli, I was using PHP 5.2.* version, and it worked. So I'm almost sure that the problem has to do with bundled <code>mysqlnd</code>.  </p>