5209R: MariaDB 5.5 vs 10.1

Posted by: mstauber Category: General

The MariaDB 10.1 PKG from the shop had some compatability issues. Here is how we fixed them.

Since a few months we've been offering a MariaDB-10.1 PKG in the BlueOnyx shop which replaced the CentOS 7 provided MariaDB-5.5 with MariaDB-10.1.

However: Several clients reported that their PHP applications then started exhibiting PHP error messages like this:

Headers and client library minor version mismatch.

After some investigation the issue became clear: This totally depends on which mechanism a PHP application uses in order to connect to MySQL/MariaDB:

  • mysql
  • mysqli
  • pdo_mysql
  • pdo_mysqli

Some are affected, some not. It also depends on how picky the PHP application is and (naturally) also on the error reporting that's configured for your PHP. Although both MariaDB versions use the same "libmysqlclient.so.18" there is of course a minor header difference, which can only be resolved by recompiling PHP against MariaDB-10.1.

Now a recompile is highly uncomfortable as it opens a can of worms. Not only would all shop PHP packages need a rebuild. No, we would also have to replace the CentOS provided "php-mysql" RPM with a version rebuilt against MariaDB-10.1. Which (in our experience) causes a ton of grief during future OS updates.

But here is the proper solution:

PHP has since long provided a replacement mechanism to allow MySQL access via PHP. Instead of compiling against the external MySQL client library we can use the MySQL drivers that ship with PHP. These are called "MySQL-nd".

CentOS 7 comes with two RPMs that provide MySQL/MariaDB support for PHP. Only one of them can be installed and you can't have both at the same time:

  • php-mysql (which we used so far)
  • php-mysqlnd (which we ought to use instead)

We just published a set of YUM updates for BlueOnyx 5209R which removes php-mysql and replaces it with php-mysqlnd.

As MySQL-nd is less picky about which version of MariaDB is installed this will solve the irritating header warning that some PHP applications used to throw.

Please note: You do not need to change anything in your PHP applications, as this should be a seamless update without any issues.

Meanwhile we are also rebuilting the latest PHP packages for 5209R in the BlueOnyx shop to use MySQL-nd. Updated PHP PKGs will become available later today (January 26th, 2017).

Jan 26, 2017 Category: General Posted by: mstauber
Next page: Features