By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,701 Members | 1,978 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,701 IT Pros & Developers. It's quick & easy.

how i retrieve the users password from mysql database

P: 147

Please help me out.....

I have created an user in the Mysql database with the password.

user : san
password : san

when i run this query :

select host,user,password from user ;
my password has been saved like this:(in encrypted form)

How i can retrieve my password in decrypted form :

please help me out ? is it possible
Jan 12 '10 #1
Share this Question
Share on Google+
2 Replies

Expert 100+
P: 250
If the stored value is a hash, you won't be able to retrieve it. You'll need to re-issue a password to the user.

If the passwords are TRULY encrypted (unlikely) then you'd need the algorithm used for encryption and the key.

By the way, that looks like a uppercased sha hash.
Jan 12 '10 #2

Expert 5K+
P: 5,058

This is the MySQL users table, not a table belonging to one of your own databases, right?

If so then no, dgreenhouse is right. You can not retrieve the password. The MySQL user passwords are encrypted (hashed) using the PASSWORD() function, which uses a one-way encryption algorithm.

The best you can do to re-enable a MySQL user with a lost password is to reset the password using the SET PASSWORD command.
For example:
Expand|Select|Wrap|Line Numbers
  1. SET PASSWORD FOR 'username'@'host' = PASSWORD('newpass');
Note that to set the password for an account other that the account you are currently logged in as, you need to be logged in as root, or a user with the UPDATE privilege on the mysql database.
Jan 13 '10 #3

Post your reply

Sign in to post your reply or Sign up for a free account.