in reply to Reversing MySQL's password function

Since no one else has mentioned it, password('$clearpass') won't pass the value of $clearpass to the function password() instead it will send the literal string $clearpass due to the single quotes.

Replies are listed 'Best First'.
Re^2: Reversing MySQL's password function
by erix (Prior) on Jan 16, 2005 at 00:49 UTC

    Don't forget that password() is a mysql function, so the following is valid usage:

    my $sql = "select password('$clearpass')";

    Nothing wrong, indeed the single quotes are needed.

    update: OP mentions $pass=password('$clearpass'), which might be taken out of an insert:

    my $sql = "insert into tab set $pass=password('$clearpass')";