In PHP I'm getting the following warning whenever I try to connect to a database (via mysql_connect
)
Warning: mysql_connect(): Headers and client library minor version mismatch. Headers:50162 Library:50524
In my php -i
output I have the following values listed under mysqli
Client API library version => 5.5.24
Client API header version => 5.1.62
I've tried updating php5-mysql and php but I'm already at the latest version of both of them. How do I go about updating the header version so I stop seeing this warning?
EDIT
My MySQL files should all be updated to be the latest version:
$ apt-get install mysql.*5.5
. . .
mysql-client-5.5 is already the newest version.
mysql-server-core-5.5 is already the newest version.
mysql-server-5.5 is already the newest version.
mysql-testsuite-5.5 is already the newest version.
mysql-source-5.5 is already the newest version.
Removing old versions
$ apt-get remove mysql.*5.1
. . .
Package handlersocket-mysql-5.1 is not installed, so not removed
Package mysql-cluster-client-5.1 is not installed, so not removed
Package mysql-cluster-server-5.1 is not installed, so not removed
Package mysql-client-5.1 is not installed, so not removed
Package mysql-client-core-5.1 is not installed, so not removed
Package mysql-server-5.1 is not installed, so not removed
Package mysql-server-core-5.1 is not installed, so not removed
Package mysql-source-5.1 is not installed, so not removed
I have this problems when use Percona/MySQL 5.6 and the php driver was compiled with 5.5 and php5-mysql is required for some apps, so I write a script to rebuild the drivers.
https://github.com/falcacibar/php5-mysql-rebuild
Your PHP was compiled with MySQL 5.1 but now it is linking a mysql library of 5.5.X family. You have to upgrade PHP to a version compiled with MySQL 5.5 or revert back mysql client libraries to 5.1.x.
Changing PHP version from 5.6 to 5.5 Fixed it.
You have to go to control panel > CGI Script and change PHP version there.
For new MySQL 5.6 family you need to install php5-mysqlnd, not php5-mysql.
Remove this version of the mysql driver
And install this instead
I am using MariaDB and have the similar problem.
From MariaDB site, it is recommended to fix it by
Run with a lower error reporting level:
My problem fixed by using the mysqlnd driver in Ubuntu:
Cheers!
[update: extra information] Installing this driver also resolve PDO problem that returns integer value as a string. To keep the type as integer, after installing mysqlInd, do this
I solved the above error by just rebuilding my Apache: