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
1 2 3 4 5 6 | PHP Warning: PDO::__construct(): The server requested authentication method unknown to the client [mysql_old_password] in /home/user/public_html/maintenance/dbmaintenance.php on line 68 SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client |
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
- 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
- Delete the database user
- Re-create the same user with the same password
- Assign user to the database
Control Panel options for MySQL user and password reset
- Site5 SiteAdmin – MySQL: Create & Manage Users
- CPanel – Add a MySQL User