PHP 5 upgrade – [mysql_old_password] construct error

Issue: Drupal, WordPress, any PHP based Website or Cron jobs stop working after your web host upgrades from PHP 4.x to 5.x. In my case the issue was random as some sites and Cron jobs on the same host broke but most did not.

Error message after upgrading PHP

The clue is “[mysql_old_password]” in the error message above generated by a failing Cron job –  PHP 5 has a new ‘mysqlnd‘ connector (MySQL Native Driver) that requires your MySQL password be stored in a 41 character hash versus older versions which only used 16.

I assumed I needed to update my PHP scripts for PHP 5.5 but found a post on Drupal forums indicating some were solving the issue simply by deleting and recreating the DB user. And… it worked for me!

Solution 1

  1. Simply update your existing current MySQL user password to the same password with your database admin tool of choice. Optionally you can change the password – but remember to update any applications!

Solution 2

  1. Delete the database user
  2. Re-create the same user with the same password
  3. Assign user to the database

Control Panel options for MySQL user and password reset

  1. Site5 SiteAdmin – MySQL: Create & Manage Users
  2. CPanel – Add a MySQL User

Leave a Reply

Your email address will not be published. Required fields are marked *