Page 1 of 1

Old mysql-client question

Posted: Thu Sep 06, 2007 10:40 am
by outrage
After upgrading to PHP 5.2 and MySQL 5 a while ago I noticed that phpinfo still displays the Client API version as 4.1.22

Because everything worked fine regardless, it hasn't bothered me until a customer thought we were not running MySQL 5 after he ran phpinfo himself.

I've Googled for over an hour and the only solutions seem to be talking of recompiling which is beyond me to be honest.

Is there an easy way to update to the current mysql-client version or should I not bother?

Posted: Thu Sep 06, 2007 10:57 am
by scott
dont bother, it doesnt really mean anything for the client.

Posted: Thu Sep 06, 2007 11:03 am
by outrage
OK I'll take your advice :)

Thanks for the quick reply Scott.

Posted: Thu Sep 06, 2007 12:17 pm
by Highland
This is only going to get worse due to phpMyAdmin 2.11 or later. When you go in you now get this message which causes people to freak out
Your PHP MySQL library version 4.1.22 differs from your MySQL server version 5.0.27. This may cause unpredictable behavior.

Posted: Thu Sep 06, 2007 4:23 pm
by scott
Changing that would break compatibility with Mysql 4. So it's not an option I'm afraid. Try rebuilding the rpm or better yet, change it with a hex editor.

Posted: Fri Sep 07, 2007 9:15 am
by Highland
Not saying it's broken, just warning you that this particular change is going to increase the instances of this question being asked.

The only "solution" I know of is to go to CentOS 5 (or maybe FC7) which has the same client version as the server.

Posted: Fri Sep 07, 2007 10:30 am
by scott
Oh believe me, I know this one pretty well. When I first started doing PHP/MySQL packages it was when we were going from 3 to 4, I was building against the latest mysql. Needless to say the shill cries of indignation were far louder when I did that. Now I just have to put up with the occasional "zomg It says mysql 4!" message (which is in the FAQ I might add) vs. an outage caused by someone --nodeps'ing around a mysql upgrade requirement.

Posted: Wed Apr 30, 2008 9:14 pm
by perceptibility
Hi scott,

I've just run into this problem using an application built with Zend Framework (1.5.1). The script throws a PHP warning:
Warning: mysqli_stmt::bind_result() [function.mysqli-stmt-bind-result]: Server returned unknown type 246. Probably your client library is incompatible with the server version you use!
which in itself is no big deal (warnings can be disabled). The real problem is that no data is being returned from the database after ~3 queries. I can copy/paste the exact same queries into phpMyAdmin and they work fine.

So, the question is, can I somehow update the PHP mysql(i) client API version to 5.0.x?

I am running:
CentOS 4.5
Plesk 8.2.0
PHP 5.2.3 (ART php-5.2.3-1)
MySQL 5.0.27 (ART mysql-5.0.27-1)

Thanks for your help, and for this invaluable resource.

Posted: Thu May 01, 2008 9:05 am
by scott
Its very easy, you just need to rebuild the php package on that system. It will automatically link against the mysql 5 libraries you're using on the box.

Posted: Thu May 01, 2008 3:27 pm
by perceptibility
Thanks scott. I was able to rebuild from your source RPMS and update the php-mysql modules.

Cheers,
Rob