You mean the mysql password of the user? No, you can't get that,
even the server can't get it, at least not the clear-text version.
When you create/change your password an encrypted version is stored in
the mysql.user table along with the hostname. If you have "SELECT"
permission on that table, you can get the encrypted version. You
could use that for some sort of separate authentication by encrypting
a user-supplied password and comparing the 2 encrypted strings but you
can't get the actual password.
In other words, if the password is 'cat' you only see
'*FD98809C60DD51B6B380DB17B72F9A9E2FE1928F in mysql.user. You could
have code that checked a user-supplied password, like:
if password(@pwd) = '*FD98809C60DD51B6B380DB17B72F9A9E2FE1928F'
but that's it.
On Thu, Jun 3, 2010 at 12:12 PM, Guillermo <srguillermoh@stripped> wrote:
> I need to get the user and password from the current session. I found the
> user() function, wich gets the username, is there anything like that to get
> the password ?
> __________ Información de ESET NOD32 Antivirus, versión de la base de
> de virus 5170 (20100603) __________
> ESET NOD32 Antivirus ha comprobado este mensaje.
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe: http://lists.mysql.com/mysql?unsub=1
Web developer / Database administrator