title: Upgrade Mysql old password to new version
body: <p>This probably has been asked before. Some passwords for the users are stored in 16 bit format. Mysql has been upgraded to 5.5, but the passwords in the table remained in a 16 bit format.</p>
  
  <p>A way to tell what password scheme your MySQL is using is to run this query below, it will list each user’s password length (16 or 41):</p>
  
  <pre><code>mysql&gt; SELECT `User`, `Host`, Length(`Password`) FROM mysql.user;
  +—————-+—————–+——————–+
  | User | Host | Length(`Password`) |
  +—————-+—————–+——————–+
  | root | localhost | 16 |
  | mary | 20.20.3.2 | 16 |
  | fred | localhost | 16 |
  | sally | 64.56.139.194 | 16 |
  | fschmidt | 64.56.139.194 | 16 |
  …
  </code></pre>
  
  <p>To change the user to having the exact same password but stored in the newer longer format, we can do this:</p>
  
  <pre><code>mysql&gt; SET SESSION old_passwords=FALSE;
  mysql&gt; SET PASSWORD FOR ‘visitlogger’@’64.55.129.%’=PASSWORD(‘ ‘);
  mysql&gt; flush privileges;
  </code></pre>
  
  <p>Now we can verify the changes:</p>
  
  <pre><code>mysql&gt; SELECT `User`, `Host`, Length(`Password`) FROM mysql.user;
  +—————-+—————–+——————–+
  | User | Host | Length(`Password`) |
  +—————-+—————–+——————–+
  | root | localhost | 41 |
  | mary | 20.20.3.2 | 41 |
  | fred | localhost | 41 |
  | sally | 64.56.139.194 | 41 |
  | fschmidt | 64.56.139.194 | 41 |
  +—————-+—————–+——————–+
  </code></pre>
  
  <p>Can anyone help me figuring out a way to make this changes automatically. It will be a pain to do this manually for all my users. Thank you!</p>