Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mysql_connect(): Headers and client library minor version mismatch Library:100005

I've got a rather tricky problem with my webserver since I performed a regular package update last Friday. I'm getting an error when using mysql_connect().

Warning: mysql_connect(): Headers and client library minor version mismatch. Headers:50532 Library:100005 in /srv/www/***/wp-includes/wp-db.php on line 1142

When I run php -i I get:

mysqli

MysqlI Support => enabled
Client API library version => 10.0.5-MariaDB  
Client API header version => 5.5.32

apt-get install mariadb*

Results in the following packages already installed:

libmariadbclient18 is already the newest version.
libmariadbclient18 set to manually installed.
mariadb-client is already the newest version.
mariadb-client-10.0 is already the newest version.
mariadb-client-10.0 set to manually installed.
mariadb-client-core-10.0 is already the newest version.
mariadb-client-core-10.0 set to manually installed.
mariadb-common is already the newest version.
mariadb-common set to manually installed.
mariadb-server is already the newest version.
mariadb-server-10.0 is already the newest version.
mariadb-server-10.0 set to manually installed.
mariadb-server-core-10.0 is already the newest version.
mariadb-server-core-10.0 set to manually installed.

I've already looked up this issue all over the web, but none of the similar issues seem to have the -MariaDB tag with the library version.

So I've no idea how I can resolve this.

Your help is greatly appreciated!

edit:

php -i mysql:

MySQL Support => enabled
Client API version => 10.0.5-MariaDB

Oddly enought there is no mention of a Client API library version or Client API header version in this section.

like image 877
SonicFC Avatar asked Nov 11 '13 16:11

SonicFC


2 Answers

Enable the mysqlnd, nd_mysql, and nd_mysqli extentions for PHP, and disable mysql and mysqli if they are enabled (PHP 5.5).

Late response, but this is high in the search results and this is the solution that worked for me, as someone who did not have admin access to the server.

like image 154
naturaljoin Avatar answered Oct 20 '22 08:10

naturaljoin


Install the mysqlnd package for PHP and the warning should go away.

For Debian/Ubuntu based systems, this would be:

sudo apt install php-mysqlnd

or

sudo apt install php7.0-mysqlnd

Restart your server daemons after installing (apache, nginx, and/or php-fpm)

like image 44
Michael Butler Avatar answered Oct 20 '22 07:10

Michael Butler