php can't connect to mysql using Pear::MDB2
This is my first LQ post, but I've been using Slackware since around 2000.
A few days back I upgraded to -current (just before the most recent major update), which included httpd-2.4.2-i486-2 and php-5.4.3-i486-3. There were quite a few changes to httpd.conf, which I've integrated into my httpd.conf, but I can't get php to connect to the local mysql database using Pear::MDB2 any more. The database is working fine, I can log in directly, and the webserver seems to be doing everything else right, but when connecting to mysql I always get Code:
MDB2 Error: connect failed Code:
MDB2 2.5.0b3 beta Code:
$db_options = array('debug' => 2); Cheers, Trevor. |
if you run
phpinfo() you may get an idea. Perhaps php is looking for the mysql socket in the wrong directory or something like that? Hope this helps, J |
Turned out the upgrade to php-5.4.3 meant that the old style mysql passwords (hashes of length 16) were being rejected by php (info found here). The fix was to reset the mysql passwords which rewrites the passwords with hashes of length 41. But first I needed to run mysql_upgrade to fix the privileges table.
Code:
[root@machine]$ mysql_upgrade -p |
I'm sure I'll run into this with an upgrade I'm planning.
Thanks for posting your solution. |
Quote:
|
All times are GMT -5. The time now is 09:29 AM. |