#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    27
    Rep Power
    0
    I am setting up a web based administrator for my MySQL database. It is mostly complete minus one detail. I cannot find an effective way to verify a MySQL user password for access verification.

    The script connects to the mysql database with the root as user and password, I need it to then check the username and password in the user table against the username and password provided by the user for login. I can retrieve the username fine with a query, but the encrypted password is seeming to be a problem.

    Any ideas would be appreciated.......
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    27
    Rep Power
    0
    Nevermind.....problem solved
  4. #3
  5. No Profile Picture
    RyanP
    Guest
    Devshed Newbie (0 - 499 posts)
    how did you solve the problem?
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    27
    Rep Power
    0
    Encrypted the password provided by the user and then compared against the encypted string extracted from the user table in MySQL. Simple, yet effective.
  8. #5
  9. No Profile Picture
    chinnavi
    Guest
    Devshed Newbie (0 - 499 posts)
    how can i encrypt the password when id dont know the encryption mechanism ?

    vijay
  10. #6
  11. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    27
    Rep Power
    0
    Run a MySql query to encrypt the password in MySql format............ie:

    #encrypt input password
    $sth = $dbh->prepare( "SELECT PASSWORD('$yourinput')" );
    if ( !defined $sth )
    {
    &log_error;
    }
    $sth->execute;
    $encrypted=$sth->fetchrow();

    ####$encrypted will now contain your password to compare against the MySql password entry...
  12. #7
  13. No Profile Picture
    ads
    Guest
    Devshed Newbie (0 - 499 posts)
    I am new to pearl. Any idea how it can be done in php.

IMN logo majestic logo threadwatch logo seochat tools logo