Forum Moderators: open

Message Too Old, No Replies

Help: MS Vista cooks my passwords in Mysql

php5, apache 2.2 mysql 5 ok on Linux, Vista broken

         

hanglide

10:23 pm on May 21, 2007 (gmt 0)

10+ Year Member



Hello,

I've ported an older 3.23 Mysql database, Php4 and apache 1.3 app to Apache 2.24, Php5.2, Mysql 5.027. Everything works fine on a newer 2.6x Linux box but my Vista box won't pass a password from a form & return validation correctly. It seems to be converting it to a different encryption level (or something).

This works:

"SELECT * FROM $table_name WHERE username = '$username' AND password = '7d455f3e7fd28ef3' ";

As does this if I cut and paste the hash above into the login form:

"SELECT * FROM $table_name WHERE username = '$username' AND password = '$password'";

But if I try to use the original password function like this:

"SELECT * FROM $table_name WHERE username = '$username' AND password = password('$password')";

It doesn't work. I tried substituting md5() in place of password() but no luck. I think that I've verified that it is using a different type of encryption by creating a new user and letting it insert a new password - the table displays a much larger hash value the the previously created passwords - I think it may also have overflowed the field as it displays an asterisk next to the hash value when viewed in phpmyadmin.

I can't believe I'm the first to run into this but I've searched every combination of php/mysql/vista broken passwords that I can think of and I'm not getting anywhere.

ANY help would be greatly appreciated.

One last thing and forgive me if this is a stupid question as I'm new to web/php/mysql development. I assume that since the The password() function is included in the Mysql statement that it is a Mysql function (and not a php function). Is this correct?

Thanks again.

Scott

hanglide

2:02 pm on May 22, 2007 (gmt 0)

10+ Year Member



Ok.. fixed it.

Changed password() function to old_password() function.

Apparently (I'm guessing) the linux server that works correctly is using the --old-passwords switch.

BTW Anybody know where to put the --old-passwords switch in Windows (Vista)?

I tried putting it in the server section of my.ini but when I try to re-start Mysql it gives errors.

I also tried changing my password field width to less than 41 bytes - which, according to Mysql docs will force it to use the old 16 byte encryption. I tried varchar (20) but didn't have any luck with that either.

Anyway... I hope this info saves somebody else several days worth of frustration...