Jump to content

Archived

This topic is now archived and is closed to further replies.

zyonsherlock

select password returns empty set

Recommended Posts

i've got a problem with my query, at first i thought it was in my php script, but it doesn't return any error. after that i run my query in mysql prompt, it seems that whenever i run a query with a "where password = password("password");", it returns an empty set. I search for some answers here and in other online forums, even in mysql ab but nothing helped me with this problem. i'm searching for errors for the past 2 days already, i don't know what to do with this, it's making me nuts already! anyone? help? please?  :'( all answers are welcome...thanks in advance! 

Share this post


Link to post
Share on other sites
Not sure, but this might be the password() compability issue in MySql 4.1 and later: http://dev.mysql.com/doc/refman/5.1/en/application-password-use.html

Share this post


Link to post
Share on other sites
What happens if you do "SELECT password("password")", and then do a query using the output of that?  Are there any matching columns?  And does the output of that first query make sense?

Share this post


Link to post
Share on other sites
when i do the select "password('password')", it shows the encrypted version, but the encrypted version is 1 (letter or number) longer than the one that was selected in "select * from table;" .
e.g.
mysql>select * from users;

user    password
duh      p102p394kr843pouk

mysql>select password('password');
           
              password('password')
              p102p394kr843pouk[b]e[/b]

When i copy that encrypted one and make a query for it, it still returns an empty set
e.g.
select username, password where username="duh" and password = "1o2j43ik4j34kjoipo";

is it the encryption of passwords?coz i think thats the problem. i've been stuck with this problem for the past 3 days already, and i dont find any typo errors or any errors at all with my query, if thats the problem, what should i do?

Share this post


Link to post
Share on other sites
Are you sure you're not accidentally truncating the encrypted password?

Share this post


Link to post
Share on other sites
hi! thanks for your help! i solved my problem a while ago. i've read the documentation of mysql for this one and i've learned that my problem was my password length, it was set to 40, it must be set to at least 41 bytes so that it can accomodate the long hashes, i've set mine to 45 just in case, thanks again!!!  ;D

Share this post


Link to post
Share on other sites
just in case someone sees this topic and want some more information about it check this link: [url=http://dev.mysql.com/doc/refman/4.1/en/password-hashing.html]dev.mysql.com/doc/refman/4.1/en/password-hashing.html[/url]. this link end my 3day brain seizure! ;D

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.