Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #2151 > unrolled thread

MySQL's PASSWORD() function

Started byqtrimble <qtrimble@gmail.com>
First post2011-06-14 11:03 -0700
Last post2011-06-15 11:26 +0200
Articles 6 — 4 participants

Back to article view | Back to comp.lang.php


Contents

  MySQL's PASSWORD() function qtrimble <qtrimble@gmail.com> - 2011-06-14 11:03 -0700
    Re: MySQL's PASSWORD() function Luuk <Luuk@invalid.lan> - 2011-06-14 20:13 +0200
      Re: MySQL's PASSWORD() function qtrimble <qtrimble@gmail.com> - 2011-06-14 11:41 -0700
        Re: MySQL's PASSWORD() function Jerry Stuckle <jstucklex@attglobal.net> - 2011-06-14 15:55 -0400
        Re: MySQL's PASSWORD() function Luuk <Luuk@invalid.lan> - 2011-06-14 22:00 +0200
    Re: MySQL's PASSWORD() function "Álvaro G. Vicario" <alvaro.NOSPAMTHANX@demogracia.com.invalid> - 2011-06-15 11:26 +0200

#2151 — MySQL's PASSWORD() function

Fromqtrimble <qtrimble@gmail.com>
Date2011-06-14 11:03 -0700
SubjectMySQL's PASSWORD() function
Message-ID<ec7892f3-96c9-4d3d-94f6-34e64213e39b@z37g2000yqb.googlegroups.com>
I'm using WAMPSERVER for my development environment (MySQL v 5.1.553,
PHP v 5.3.4) . The software that I am modifying uses the MySQL
PASSWORD() function which works fine locally.  After moving the code
and database to the production server (MySQL v 5.0.77, PHP v 5.3.3) I
cannot log in.

Is there anything other than the versions that could cause this
behavior?  I was thinking maybe PHP extensions but I do not know what
the PASSWORD() function depends on.

[toc] | [next] | [standalone]


#2152

FromLuuk <Luuk@invalid.lan>
Date2011-06-14 20:13 +0200
Message-ID<4df7a4b6$0$49044$e4fe514c@news.xs4all.nl>
In reply to#2151
On 14-06-2011 20:03, qtrimble wrote:
> I'm using WAMPSERVER for my development environment (MySQL v 5.1.553,
> PHP v 5.3.4) . The software that I am modifying uses the MySQL
> PASSWORD() function which works fine locally.  After moving the code
> and database to the production server (MySQL v 5.0.77, PHP v 5.3.3) I
> cannot log in.
> 
> Is there anything other than the versions that could cause this
> behavior?  I was thinking maybe PHP extensions but I do not know what
> the PASSWORD() function depends on.

Something changed about storing passwords in MySQL between version 4.x
and 5.0

A compatibility switch was introduced in 5.0

I think it no longer exists in 5.1

All info is here:
http://dev.mysql.com/doc/refman/5.1/en/password-hashing.html

If you have access to both systems check the output of:
SELECT PASSWORD('something');

and see if the output on both systems is the same,...

-- 
Luuk

[toc] | [prev] | [next] | [standalone]


#2154

Fromqtrimble <qtrimble@gmail.com>
Date2011-06-14 11:41 -0700
Message-ID<43b1c38b-3f8f-457a-b283-54f6e4551193@j31g2000yqe.googlegroups.com>
In reply to#2152
On Jun 14, 2:13 pm, Luuk <L...@invalid.lan> wrote:
> On 14-06-2011 20:03, qtrimble wrote:
>
> > I'm using WAMPSERVER for my development environment (MySQL v 5.1.553,
> > PHP v 5.3.4) . The software that I am modifying uses the MySQL
> > PASSWORD() function which works fine locally.  After moving the code
> > and database to the production server (MySQL v 5.0.77, PHP v 5.3.3) I
> > cannot log in.
>
> > Is there anything other than the versions that could cause this
> > behavior?  I was thinking maybe PHP extensions but I do not know what
> > the PASSWORD() function depends on.
>
> Something changed about storing passwords in MySQL between version 4.x
> and 5.0
>
> A compatibility switch was introduced in 5.0
>
> I think it no longer exists in 5.1
>
> All info is here:http://dev.mysql.com/doc/refman/5.1/en/password-hashing.html
>
> If you have access to both systems check the output of:
> SELECT PASSWORD('something');
>
> and see if the output on both systems is the same,...
>
> --
> Luuk

The documentation states that prior to MySQL 4.1, password hashes
computed by the PASSWORD() function are 16 bytes long which is what
the result is when I tried your suggestion (SELECT
PASSWORD('something')) on my production server but my production
server MySQL version is 5.0.77.  My development server is returning 41
byte.  I also never did an upgrade which the documentation suggests
upgrading to 4.1 and then to 5 or higher.  I installed 5.0.77
directly.  This seems strange to me...any suggestions?

[toc] | [prev] | [next] | [standalone]


#2156

FromJerry Stuckle <jstucklex@attglobal.net>
Date2011-06-14 15:55 -0400
Message-ID<it8ebj$96p$2@dont-email.me>
In reply to#2154
On 6/14/2011 2:41 PM, qtrimble wrote:
> On Jun 14, 2:13 pm, Luuk<L...@invalid.lan>  wrote:
>> On 14-06-2011 20:03, qtrimble wrote:
>>
>>> I'm using WAMPSERVER for my development environment (MySQL v 5.1.553,
>>> PHP v 5.3.4) . The software that I am modifying uses the MySQL
>>> PASSWORD() function which works fine locally.  After moving the code
>>> and database to the production server (MySQL v 5.0.77, PHP v 5.3.3) I
>>> cannot log in.
>>
>>> Is there anything other than the versions that could cause this
>>> behavior?  I was thinking maybe PHP extensions but I do not know what
>>> the PASSWORD() function depends on.
>>
>> Something changed about storing passwords in MySQL between version 4.x
>> and 5.0
>>
>> A compatibility switch was introduced in 5.0
>>
>> I think it no longer exists in 5.1
>>
>> All info is here:http://dev.mysql.com/doc/refman/5.1/en/password-hashing.html
>>
>> If you have access to both systems check the output of:
>> SELECT PASSWORD('something');
>>
>> and see if the output on both systems is the same,...
>>
>> --
>> Luuk
>
> The documentation states that prior to MySQL 4.1, password hashes
> computed by the PASSWORD() function are 16 bytes long which is what
> the result is when I tried your suggestion (SELECT
> PASSWORD('something')) on my production server but my production
> server MySQL version is 5.0.77.  My development server is returning 41
> byte.  I also never did an upgrade which the documentation suggests
> upgrading to 4.1 and then to 5 or higher.  I installed 5.0.77
> directly.  This seems strange to me...any suggestions?

Ask in comp.databases.mysql.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#2157

FromLuuk <Luuk@invalid.lan>
Date2011-06-14 22:00 +0200
Message-ID<4df7bde4$0$49048$e4fe514c@news.xs4all.nl>
In reply to#2154
On 14-06-2011 20:41, qtrimble wrote:
> On Jun 14, 2:13 pm, Luuk <L...@invalid.lan> wrote:
>> On 14-06-2011 20:03, qtrimble wrote:
>>
>>> I'm using WAMPSERVER for my development environment (MySQL v 5.1.553,
>>> PHP v 5.3.4) . The software that I am modifying uses the MySQL
>>> PASSWORD() function which works fine locally.  After moving the code
>>> and database to the production server (MySQL v 5.0.77, PHP v 5.3.3) I
>>> cannot log in.
>>
>>> Is there anything other than the versions that could cause this
>>> behavior?  I was thinking maybe PHP extensions but I do not know what
>>> the PASSWORD() function depends on.
>>
>> Something changed about storing passwords in MySQL between version 4.x
>> and 5.0
>>
>> A compatibility switch was introduced in 5.0
>>
>> I think it no longer exists in 5.1
>>
>> All info is here:http://dev.mysql.com/doc/refman/5.1/en/password-hashing.html
>>
>> If you have access to both systems check the output of:
>> SELECT PASSWORD('something');
>>
>> and see if the output on both systems is the same,...
>>
>> --
>> Luuk
> 
> The documentation states that prior to MySQL 4.1, password hashes
> computed by the PASSWORD() function are 16 bytes long which is what
> the result is when I tried your suggestion (SELECT
> PASSWORD('something')) on my production server but my production
> server MySQL version is 5.0.77.  My development server is returning 41
> byte.  I also never did an upgrade which the documentation suggests
> upgrading to 4.1 and then to 5 or higher.  I installed 5.0.77
> directly.  This seems strange to me...any suggestions?

on the link it says:
The way in which the server generates password hashes for connected
clients is affected by the width of the Password column and by the
--old-passwords option. A 4.1 or later .....

which refers to:
http://dev.mysql.com/doc/refman/5.0/en/server-options.html#option_mysqld_old-passwords


-- 
Luuk

[toc] | [prev] | [next] | [standalone]


#2176

From"Álvaro G. Vicario" <alvaro.NOSPAMTHANX@demogracia.com.invalid>
Date2011-06-15 11:26 +0200
Message-ID<it9tt2$dd9$1@dont-email.me>
In reply to#2151
El 14/06/2011 20:03, qtrimble escribió/wrote:
> I'm using WAMPSERVER for my development environment (MySQL v 5.1.553,
> PHP v 5.3.4) . The software that I am modifying uses the MySQL
> PASSWORD() function which works fine locally.  After moving the code
> and database to the production server (MySQL v 5.0.77, PHP v 5.3.3) I
> cannot log in.
>
> Is there anything other than the versions that could cause this
> behavior?  I was thinking maybe PHP extensions but I do not know what
> the PASSWORD() function depends on.

I suppose you are talking about your application users, not MySQL users.

You can use OLD_PASSWORD() if you need to emulate the old format in a 
new system:

http://dev.mysql.com/doc/refman/5.1/en/encryption-functions.html#function_old-password


SELECT PASSWORD('abcd'), OLD_PASSWORD('abcd')

*A154C52565E9E7F94BFC08A1FE702624ED8EFFDA    2e64a4f078c68549


-- 
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://borrame.com
-- Mi web de humor satinado: http://www.demogracia.com
--

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.php


csiph-web