tags:

views:

296

answers:

3

Hi there, I've been working on a content managed site that's been working fine on localhost. I've just uploaded the files to my mediatemple server.. and am seeing some pretty interesting results:

Warning: mysqli_stmt::bind_result() [mysqli-stmt.bind-result]: Server returned unknown type 246. Probably your client library is incompatible with the server version you use!

Has anyone ever seen anything like this before. I'm completely stumped! Works great on localhost (MAMP), but breaks on the live server :-(.

Thanks a lot!

A: 

It should be a MySQL version problem.

This is what I found in another forum:

apt-get source php5-mysqli
cd php5-...
./configure --with-mysqli=/usr/bin/mysql_config --without-mysql
make
cp ext/mysqli/modules/mysqli.so /usr/lib/php5/...

Obviously you probably have different folder names, but I hope you get the idea.

Franz
+2  A: 

In MySQL 5.0.3, a new field type was introduced, to support fixed-point math with more accuracy. This new field type is identified in the MySQL protocol with a numeric value 246.

If you have a MySQL server running 5.0.x or higher, and you use the NUMERIC or DECIMAL, it's incompatible with the DECIMAL field type used in the MySQL 4.x client.

http://dev.mysql.com/doc/refman/5.0/en/upgrading-from-previous-series.html says:

Because the MySQL 5.0 server has a new implementation of the DECIMAL data type, a problem may occur if the server is used by older clients that still are linked against MySQL 4.1 client libraries. If a client uses the binary client/server protocol to execute prepared statements that generate result sets containing numeric values, an error will be raised: 'Using unsupported buffer type: 246'

This error occurs because the 4.1 client libraries do not support the new MYSQL_TYPE_NEWDECIMAL type value added in 5.0. There is no way to disable the new DECIMAL data type on the server side. You can avoid the problem by relinking the application with the client libraries from MySQL 5.0.

Also see http://bugs.php.net/bug.php?id=35536

You should be able to resolve this issue by upgrading your MySQL client library in PHP. Either rebuild PHP, or else just drop in a new MySQL client binary.

Best of all would be to use the newer mysqlnd library, which gives you a lot of benefits to performance and functionality. That library is included in the source distribution of PHP 5.3 and later. It states in the FAQ that it requires PHP 5.3, which actually surprises me, but that's what they say.

Bill Karwin
A: 

Change your DECIMAL type to FLOAT in the database until it's supported.

mal