RE: [PHP-DB] Connecting to MySQL Database
| From: | Jonathan Hilgeman | Date: | Thu, 13 Dec 2001 16:25:07 +0000 |
| Subject: | RE: [PHP-DB] Connecting to MySQL Database | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-14996@lists.php.net to get a copy of this message | ||
Can you show us the code that checks the username and password to see if
they're correct?
Is this a custom admin page that you created?
If your page is authenticating against the "mysql" database, then you should
know that MySQL encrypts the password and stores the encrypted password.
So if you use the GRANT statement to create a new user that looks like:
User: admin
Pass: Secrets
...MySQL will store this as:
User: admin
Pass: Ata91230t!44
So if you try to login and your login code looks like:
if($PasswordEntered == $DatabasePassword)
{
...
}
So even if $PasswordEntered equals "Secrets", it won't be the same, because
it won't match the encrypted password.
- Jonathan
-----Original Message-----
From: Michael Elliott [mailto:camley88@cfl.rr.com]
Sent: Thursday, December 13, 2001 5:54 AM
To: php-db@lists.php.net
Subject: [PHP-DB] Connecting to MySQL Database
I am trying to create an admin page to administer my database. I used a
file .sql to create my database. In the file, I included:
grant select, insert, update, delete
on database.*
to admin@localhost identified by 'password';
Why can I not log in successfully using admin and password?
Thanks
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
For additional commands, e-mail: php-db-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net