Unable to get pdo_mysql to work with CentOS 6 and MariaDB 5.5.32

I just installed from YUM the MariaDB-server and MariaDB-client.

These are the packages installed:

compat-mysql55.x86_64 MariaDB-client.x86_64 MariaDB-common.x86_64 MariaDB-compat.x86_64 MariaDB-server.x86_64 MariaDB-shared.x86_64

But when trying to run a PHP script that uses PDO (which worked with MySQL 5.5), I get this error:

PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/pdo_mysql.so' - /usr/lib64/php/modules/pdo_mysql.so: symbol mysql_options, version libmysqlclient_18 not defined in file libmysqlclient.so.18 with link time reference in Unknown on line 0

I have searched Google and here quite a bit but can't seem to find the answer. Any help would be greatly appreciated.

Answer Answered by Sergei Golubchik in this comment.

Did you compile pdo_mysql.so yourself? Against MySQL client library from Oracle? That would explain the error you're seeing.

When we added symbol versioning to our client library we carefully tried to keep it drop-in replacement and picked exactly the same versioning that CentOS mysql-libs package uses.

In this versioning logic, mysql_options has version libmysqlclient_16, because, indeed, it was present in the old libmysqlclient.so.16 and it haven't changed since. Thus it retained the old version.

MySQL client library from Oracle, on the other hand, has all symbols under the new libmysqlclient_18 version, even symbols that have not changed when the version was incremented. This makes Oracle libmysqlclient.so.18 incompatible with CentOS mysql-libs and with our client library.

I would recommend you to recompile pdo_mysql.so using either CentOS or our libmysqlclient.so. Or install pdo_mysql from CentOS yum repository


Comments loading...
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.