Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is there any way to display the passwords in the user table? 2

Status
Not open for further replies.

peterv12

Technical User
Dec 31, 2008
108
US
I have a few old mysql databases and have forgotten the user passwords. I know that I can delete the old users and recreate them, but is there a way that I can display what their current passwords are in a readable form?
 
No. But you don't need to delete the users, just update the records with new passwords.
 
I thought I needed to have the old password to change it. Everything I read said <old password> <new password>. If this isn't the case, would you mind posting the correct syntax for me?
Thanks...
 
If you have root access to the DB, you can simply issue an Update query on the user table.


Code:
UPDATE `user` SET `Password`=PASSWORD("newpass") WHERE `User`="username"

Note the backticks, and the Password function to encode the password.

----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Behind the Web, Tips and Tricks for Web Development.
 
The backticks are unnecessary.

Don't forget to run FLUSH PRIVILEGES after changing the password that way. If you don't the new password will not be recognized.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top