Philipp
Philipp

Reputation: 45

How to switch old-passwords OFF in Mysql 4.1

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

Upvotes: 1

Views: 4354

Answers (1)

martin clayton
martin clayton

Reputation: 78135

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 ''

Upvotes: 1

Related Questions