Re: Secure MySQL Access md5()
| From: | Uzi Klein | Date: | Fri, 14 May 2004 02:42:01 +0000 |
| Subject: | Re: Secure MySQL Access md5() | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-34427@lists.php.net to get a copy of this message | ||
"Gary Theisen" <gary.theisen@eds.com> wrote in message
news:E2455C8B4A4AD21187C700805F31BC23272806E1@ussam202.exwe01.exch.eds.com...
>
> Hi all,
>
> I've got:
>
> WinNT
> php 4.3.1
> phpmyadmin 2.5.6
> MySQL 4.0.18-nt
>
> I can connect to my db via my php script using:
>
> [php]
> $connection = mysql_connect ("localhost", "root", "")
> [/php]
>
> That works no problem.
>
> This will not work however:
>
> [php]
> $somePass = md5("somePass");
and why would you do that??
just type the username and password...
> $connection = mysql_connect ("localhost", "someID", $somePass)
> [/php]
>
> gives me this error:
>
> [quote]
> Access denied for user: 'someID@localhost'
> <mailto:'someID@localhost'>
> (Using password: YES)
> [/quote]
>
> I set someID up in the db using phpmyadmin, with it's password using the
> md5() function. I can see via phpmyadmin that someID does indeed have a
32
> byte encrypted password stored.
>
> I can then compare the stored md5 password to the md5 password I'm passing
> to try to connect...via $somePass. The encrypted passwords match exactly.
>
> Why wouldn't the match be confirmed...allowing me to connect?
>
> Thanks!
>