Jump to content


Photo

phpMyAdmin using PASSWORD function


  • Please log in to reply
3 replies to this topic

#1 ITStudent

ITStudent
  • New Members
  • Pip
  • Newbie
  • 3 posts
  • LocationGalway, Ireland

Posted 06 July 2006 - 12:36 AM

I created a login in page that compares the entered password to the password stored in the MYSQL database. The password stored in the database is encrypted using the PASSWORD function, so I encrypt the entered password with the PASSWORD function and compare with that in the database. Everything works fine on my own server, which I used to test the scripts. However, on hosting company it will not work. The problem is with the PASSWORD function.

I use mysql ver 5.0.15-nt with phpMyAdmin 2.6.4-pl3
Hosting company uses mysql ver 4.1.19-standard with phpMyAdmin 2.8.0.2

Anyone any ideas what could be wrong? (It works if I don't encrypt the password)

Thanks.


#2 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 06 July 2006 - 07:54 AM

Don't use the PASSWORD() function... there are plenty of other standard algorithms that both MySQL and PHP support.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

#3 ITStudent

ITStudent
  • New Members
  • Pip
  • Newbie
  • 3 posts
  • LocationGalway, Ireland

Posted 06 July 2006 - 07:59 PM

I also tried encrypt and encode/decode same problem. Any other sugestions?

#4 Wildbug

Wildbug
  • Members
  • PipPipPip
  • Advanced Member
  • 1,149 posts

Posted 06 July 2006 - 08:26 PM

MD5() or SHA1() are fine hashing algorithms.

As fenway alluded to, you're not supposed to use the MySQL PASSWORD() function for your own schemes, just inputting actual MySQL access passwords.  I think they changed its underlying scheme at some point, perhaps between the differing versions you and your ISP have, and that's pretty much why you're not supposed to use it.  They reserve the right to change it at any time.
Twice a day my clock works PERFECTLY!  I can't figure out what's wrong with it.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users