Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Update to php5.3 breaks connecting to mysql db

Tags:

php

mysql

I just updated php to 5.3 and can no longer connect to my remote mysql server. I get the following errors:

mysqli_connect(): OK packet 6 bytes shorter than expected
mysqli_connect(): (HY000/2000): mysqlnd cannot connect to MySQL 4.1+ using old authentication

It seems this has to do with the new mysqlnd driver. Is there a way to force it to use the old libmysql driver. Also, reverting to php5.2.11 doesn't seem to fix the issue which seems to work for most people.

like image 695
giroy Avatar asked Nov 14 '22 14:11

giroy


1 Answers

Well I typed up a long cool response but someone better than me already has answered it. The tldr; of this response is recompile your php for your application.

http://news.php.net/php.internals/43535

Ionut G. Stan schrieb:

Warning: mysql_connect() [function.mysql-connect]: OK packet 6 bytes shorter than expected in {filename} on line 18 Warning: mysql_connect() [function.mysql-connect]: mysqlnd cannot connect to MySQL 4.1+ using old authentication in {filename} on line 18

This says everything. You cannot use old authentication with mysqlnd.

Upgrade you server passwords to the more recent and more secure authentication method or recompile PHP with libmysql (MySQL Client Library) support. Check ./configure --help | grep -C3 mysql and http://www.php.net/manual/en/mysql.installation.php .

like image 173
Cranium Slows Avatar answered Dec 17 '22 05:12

Cranium Slows