views:

186

answers:

1

Hi there,

I am having a hard time migrating my MySQL 4.1 database from old 16-byte password hashes to the new 41-byte hashes. The problem is, that the mysqld server automatically starts with the "old-passwords = on" directive, which restricts setting new passwords to 41-bytes length.

My question: Does anyone know how I can tell mysqld to run without the "old-passwords = on" directive? I tried my.ini, commmandline, setting the variable locally, but nothing worked.

Thanks a lot! Philipp

+1  A: 

The first thing to check is the width of the user table Password field in the mysql database. Prior to 4.1 this was 16 characters wide. When upgrading to 4.1 the width should have been changed to 41 characters by means of the mysql_upgrade utility provided. If that step was missed for some reason the server would default to using the old 16-byte hashes, which is the behaviour you describe.

There's a write up of this in the MySQL docs.

If you find that your table does need to be updated from char(16) to char(41) and you have the mysql_update utility, run that to complete the upgrade. Alternatively (take a backup and then you can) update manually using:

ALTER TABLE user
MODIFY Password char(41) character set latin1 collate latin1_bin NOT NULL default ''
martin clayton
Thanks martin,updating the password length as you mentioned was also a necessary step to solve my problem, but not the only one.I found out that I had to set the flag "old-password=0" in my my.ini config file. It is very important to set this option in the correct section of the ini-file. Section names seem to correspond with windows service names: In my case, the windows service name is "MySQL4" - unfortunately this section had to be manually created, as the default name after setup seems to be "mysqld".All the best!
Philipp