Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I have full access to a 'MYSQL 5.0.27-community-nt-log' database one of our new updates for a core app requires PHP 5.4, after installing and configuring I'm stuck at the error regarding old vs. new passwords.

I've followed every thread I can find and I'm pretty sure I understand the process:

  1. Disable 'old_passwords'
  2. Reset the password to the new 41 encryption

But I cannot seem to get 'old_passwords' to be set to 'OFF'. Logging in as root I've tried the following:

  • I've removed it from the my.cnf file (I've also tried setting it to '0', 'False' etc)
  • Manually setting it in the query browser both globally and session
  • Turning the option on/off in MYSQL administrator

and restarted the service but 'show variables like 'old_passwords' always reports as 'ON'.

Changing the password still remains at a 16 length.

I'm sure once I'm able to turn this variable off I should be fine, Any advice?

share|improve this question

3 Answers 3

up vote 0 down vote accepted

I have 3 additional suggestions (choose one):

  • Downgrade the PHP drivers (which understand the 16 character encrypted password)
  • Upgrade to the latest MySQL (where you can set old_password=1 from inception)
  • Change all the passwords in mysql.user to 41 character encrypted password format

Whatever you do, do not use the MD5 function to make new passwords. Use the PASSWORD function. It is very different from MD5:

The password function PASSWORD function is the equivalent of

SET @my_new_password = 'WhateverIWantAsThePassword';
SELECT UPPER(SHA1(UNHEX(SHA1(@my_new_password))));

I learned that like 2 years ago from this PalominoDB Blog Post.

You can QA the PASSWORD function with OLD_PASSWORD function. Compare the output of SELECT PASSWORD(@my_new_password); WITH SELECT OLD_PASSWORD(@my_new_password);.

share|improve this answer
    
It's been a while but during that upgrade I ended up doing a combination, going to a latest MySQL as well as PHP and updating the required passwords. –  mhouston100 Dec 27 '13 at 23:34

I forgot to return earlier but none of the answers provided worked and after a few days of playing around I eventually bit the bullet and upgraded the MySQL server to the latest version.

So in the end I never found a workable solution but the problem is gone.

share|improve this answer

If you have set old_passwords=1 lower down in your my.cnf file, the last setting takes priority. So check the full length of your my.cnf for another line that sets this variable.

share|improve this answer
    
Checked and re-checked, line by line. It is not mentioned anywhere. I have noticed, if I check the box in 'MYSQL Administrator' it does add the entry, but with no value. Setting the value to 0 or 1 or removing it completely makes no difference to the variable. –  mhouston100 Sep 27 '13 at 0:59

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.