A Gotcha: PHP Stops Working After Upgrading MySQL on the Server

Tech Sharing 2019-03-25
A Gotcha: PHP Stops Working After Upgrading MySQL on the Server

After uninstalling MySQL 5.1 and upgrading to 5.7, PHP suddenly stopped working — because php-mysqlnd was removed too; reinstalling it fixes the problem.

The server previously ran MySQL 5.1. Since 5.1 doesn''t support utf8mb4, I uninstalled it entirely (removing all libs) and upgraded to 5.7.

But after the upgrade, the site''s PHP wouldn''t run — quite a scare.

After ruling things out, it wasn''t Apache. It turned out that uninstalling MySQL 5.1 also removed php-mysqlnd — shown in the system as php56w-mysqlnd-5.6.40-1.w6.x86_64.

Just reinstall it:

yum install php-mysqlnd

Restart Apache afterward and PHP works again.