Search code examples
mysqlapacheosx-snow-leopard

Getting mysqlnd error when using Snow Leopard's Apache


After installing Snow Leopard I got the following error when connecting to a remote MySQL server:

mysqlnd cannot connect to MySQL 4.1+ using old authentication

What I don't get is why it's working fine with MAMP when I only start MAMP's Apache, but I get this error with Snow Leopard's build in Apache. Is it because MAMP has some MySQL files locally? Do I still need to install MySQL locally when I try to connect to a remote server? Any clue as to how to fix this on my side without messing around with the server? Preferably Apache only — don't want to install anything I don't need.

Edit: solution
Turned out PHP wasn't loading any php.ini file. A sudo cp /etc/php.ini.default /etc/php.ini did the trick. First it was only loading php-mysqlnd, now php-mysql as well, and all is fine.

Hmm, I was wrong, this doesn't solve anything.


Solution

  • Any luck with this? I'm having the same exact issue. I tried resetting the password using both pre 4.1 and post 4.1 authentication with no avail.

    EDIT::

    My mysql server had the use old passwords option set in the configuration file, so the result of PASSWORD() and OLD_PASSWORD() returned the same 16 digit hash.

    I ran SELECT PASSWORD('mysecret') on a different mysql server that uses new passwords to get the hash, then ran SET PASSWORD FOR 'myuser'@'%' = '*THEHASHFROMTHESELECTSTATEMENT';.

    hth