Hey, I have a php scripts that needs to connect to a mysql database, however whenever it tries it returns the error
PHP Warning: Creating default object from empty value in /home/james/bin/shellme on line 86 PHP Warning: mysql_connect(): The server requested authentication method unknown to the client [mysql_old_password] in /home/james/bin/shellme on line 395
This scripts works as it should for every non arch system I have access to.
I can connect to the database fine from the mysql command (mysql Ver 15.1 Distrib 5.5.30-MariaDB, for Linux (x86_64) using readline 5.1) just not from php.
It appears that php ships with an old version of mysql native drivers:
mysql MySQL Support => enabled Active Persistent Links => 0 Active Links => 0 Client API version => mysqlnd 5.0.10 - 20111026 - $Id: e707c415db32080b3752b232487a435ee0372157 $
Is there anyway to either update the native driver or use an up to date external driver?
The mysqlnd version is the latest, no problem here. But it seems you are using an old password scheme on the mysql server which is no longer supported by PHP. The solution is to update your password database.
Except that I can connect to the database from the mysql client version 5.5.30 on same box, just not from mysqlnd version 5.0.10 in php on that box. Also on my other boxes that it does work in php reports a much more up to date version of the mysql extension:
mysql MySQL Support => enabled Active Persistent Links => 0 Active Links => 0 Client API version => 5.5.29