MySQL Forums
Forum List  »  Newbie

Re: A SQL problem
Posted by: Felix Geerinckx
Date: May 02, 2005 12:40AM

Albert Young wrote:

> I have a table storing user information.
> Previously the passwords are stored as plain text. Now our customer asks
> the passowrds to be MD5.
> Is there any simple way of looping on all the rows and update all the passwords?

1) Make sure your password column is (at least) char(32);
2) Issue the following command:

UPDATE users SET password = md5(password);

But beware: there is no way to recover the plain-text passwords after this (which in fact is a good thing).

--
felix

Options: ReplyQuote


Subject
Written By
Posted
May 01, 2005 09:40PM
Re: A SQL problem
May 02, 2005 12:40AM
May 02, 2005 09:20PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.