Forum Moderators: coopster

Message Too Old, No Replies

MySQL passwords from php page don't work

         

mark l sanders

11:29 pm on Nov 1, 2004 (gmt 0)

10+ Year Member



Default install of MySQL server 4.1.7-nt on XP Pro SP2. PHP version 4.3.10-dev on Apache 2.

Using passwords on MySQL, and then from PHP page leads to connection error based on client version.

If passwords are taken out of the equation, connections work.

I know this is something to do with ways MySQL encrypts its passwords - server and client are out of synch.

I don't understand: is there a MySQL client built into PHP - do I need to upgrade part of the PHP installation?

coopster

11:34 pm on Nov 1, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



What do your error messages say? Turn on error_reporting() [php.net] and it probably has something to do with msg #9 here:

[webmasterworld.com...]

mark l sanders

9:33 am on Nov 2, 2004 (gmt 0)

10+ Year Member



It has everything to do with that topic! What's going on is that the version of the MySQL server uses password hashing that is not backwards compatible with the older clients.
Unfortunately, the older client is still implemented in the libraries that are built into the currently available binaries of PHP for Windows (I think...).
I believe the solution is to build PHP pointing it at the libraries that come with MySQL (otherwise it uses it's own - older - libraries that don't work with new password hashing.
But I don't know how to - or want to - rebuild!
the workaround is to redefine the passwords in MySQL using OLD_PASSWORD(), as in: mysql> SET PASSWORD FOR 'some_user'@'some_host' = OLD_PASSWORD('mypass');

Great! But - does anyone know if there are any Win32 binaries available for PHP that are already built with updated libraries?