Entry
How do I get the plain text password from encryped password using password()?
Sep 19th, 2003 06:52
Wes Gilster, Reiner Kremzow, Jonathan Lee,
The answer is that you can't get the plain text password from an encryped password. These passwords are what you call one time encryption similar to the MD5 hashing algorithm. The way these passwords are used by MySQL is this:
1. You give a username and password.
2. The password you gave is encrypted by the MySQL authenticator.
3. A SELECT query is composed of the username and the new encypted password like this:
SELECT * FROM mysql.user WHERE User = 'MyUserName' AND password = password('MyUnEncyptedPassword')
4. The host from which you are connected to is compared to the Host column in the returned resultSet and your MySQL user rights are assigned according to the first matching row that is returned from the above resultset.