Updating MariaDB to v10.3.26 (and 10.2.35) has been reported to generate errors on sites with PHP versions older than 7.3. This update also caused The MySQL Databases interface to show MySQL as offline.
If your website is running WHMCS, please review their article here for hotfixes:
Troubleshooting a Critical Error - Could not connect to the database Error
Examples of errors you might see after this update can be found below (you may want to review Why is my PHP website blank or showing a white page? for tips on reviewing PHP errors):
[04-Nov-2020 08:24:41 UTC] PHP Fatal error:
Uncaught XF\Db\Exception: MySQL query error : Malformed communication packet in
#0 /home/user/docroot/file.php(196): XF\Db\AbstractStatement->getException('MySQL query err...', 1835, 'HY000')
#1 /home/user/docroot/file3.php(77): XF\Db\Mysqli\Statement->getException('MySQL query err...', 1835, 'HY000')
#2 /home/user/docroot/file4.php(79): XF\Db\Mysqli\Statement->execute()
#3 /home/user/public_html/community/src/XF/Db/AbstractAdapter.php(116): XF\Db\AbstractAdapter->query('\n\t\t\tSELECT data...', Array)
#4 /home/user/public_html/community/src/XF/DataRegistry.php(137): XF\Db\AbstractAdapter->fetchPairs('\n\t\t\tSELECT data...')
#5 /home/user/public_html/community/src/XF/DataRegistry.php(82): XF\DataRegistry->readFromDb(Array, Array)
#6 /home/user/public_html/community/src/XF/DataRegistry.php(225): XF\DataRegistry- in /home/user/public_html/community/src/XF/Db/AbstractStatement.php on line 212
PHP Fatal error: Call to a member function fetch() on boolean in file.php on line 104
As mentioned in the Symptoms, this is related to and caused by the latest update to MariaDB 10.2 and 10.3. Specifically, 10.3.26 and 10.2.35.
This update appears to be impacting sites on PHP <=7.2 and making use of certain PDO statements.
An upstream bug report was filed to the maintainers of MariaDB and can be found here:
MDEV-24121 Recent MariaDB update appears to have introduced a DB connection issue for PHP < 7.3 (or anything using PDO)
* Update: MariaDB has released updates to resolve the issue case MDEV-24121.
- Version: 10.3.27, 10.2.36
Follow up to MDEV-19838 to alter protocol checks to support the following
implementations (which add garbage to the end of some packets):
PHP PDO (all versions) (MDEV-24121)
mysqlnd (from PHP < 7.3) (MDEV-24121)
mysql-connector-python (all versions) (MDEV-24134)
and mysql-connector-java (all versions)
* Update to the latest version of 10.2 or 10.3 to resolve the issue. For some, this may require removing yum version locks on the MariaDB packages.
If packages are locked for MariaDB clear the lock with the below command:
yum versionlock clear
Otherwise, proceed with the updates for MariaDB:
yum upgrade MariaDB-*
If you would prefer to not change the version to the fixed version of MariaDB at this time the below details provide an alternative solution.
The best option to resolve these database errors is to update the PHP version for websites to use at least PHP version 7.3. The website developer may need to make changes to the website to make sure it is compatible. Still, otherwise, the MultiPHP Manager (or PHP Selector if using CloudLinux™ and CageFS™) in the cPanel interface or WHM can update the PHP version as long as newer versions are installed. See also:
How to change the PHP version for a domain in cPanel or WHM
How to change the system default PHP version in WHM
How To Install a PHP Version in WHM