Jump to content

Password Function


garyblackpool
 Share

Recommended Posts

hi,I have been making a mysql database with the password column used password function but when i queried it returned empty result. But when i changed it to use the md5 function it worked.I'm just wondering if anyone could tell me why that happened.

SELECT * FROM alc_user WHERE username = 'mandy' AND pass= MD5('beer')

SELECT * FROM alc_user WHERE username = 'mandy' AND pass= PASSWORD('beer')

Link to comment
Share on other sites

The obvious answer would be that the password is stored using MD5 and the password function does not use MD5.

NoteThe PASSWORD() function is used by the authentication system in MySQL Server; you should not use it in your own applications. For that purpose, consider MD5() or SHA1() instead. Also see RFC 2195, section 2 (Challenge-Response Authentication Mechanism (CRAM)), for more information about handling passwords and authentication securely in your applications.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...