Authentication with Old Password No Longer Supported, Use 4.1 Style Passwords

Hashing MySql passwords gives: Authentication with old password no longer supported, use 4.1 style passwords

First, a couple things about authentication in general;

There are normally two types of authentication used in developing applications:

database authentication - This is how the application authenticates for access to the database

user authentication - This is how the user authenticates to your application for access

The article you link to above is talking about user authentication, whereas your question is actually about database authentication.

The original hashing algorithm used by MySQL (prior to 4.1) has been deemed to be unsecure. Version 4.1 implements a new hashing algorithm. The password in your connection string does not need to be hashed, the hashing is performed internally in your .Net connector during authentication to the database (it is done for you). The problem is if you've upgraded your database from a pre-4.1 version and not reset the password to use the new hashing.

You can do either of two things to rectify the situation. These scripts are run at the database.

  1. To allow the database to accept the oldstyle hash run

SET old_passwords=TRUE


  1. Set a new password using the new hashing

SET old_passwords=FALSE

SET PASSWORD=PASSWORD('your_new_password_here')

The suggestion is to use the second method and use the new hashing algorithm because it makes your database access more secure.

Authentication with old password no longer supported

We had a similar issue a few days back after an upgrade to Mysql 5.6 from 5.5 even though the user was using the new 42-bit hash for awhile and not the old 16-bit hash.

I tend to stay away from the set command when updating a password instead use: UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='yourusername';
then do a flush privileges;

If that does not work. Delete the user, do a flush privileges, recreate that user, issue proper grants, and do another flush privileges.

This is what worked in our situation for the Authentication with old password not supported error.

MySQL Using Old Auth Method

I just solved my problem:

1) Connect to the db with mysql workbench (select the "use old auth" and "send pass in cleartext"

2) Using the workbench, I ran the following several times (because it kept saying '0 rows affected'): (also change userID and password to your proper stuff)

SET SESSION old_passwords=0; 
SET PASSWORD FOR userID=PASSWORD('password');

SET SESSION old_passwords=false;
SET PASSWORD FOR userID=PASSWORD('password');

3) Now go back to your app and it should run...

That is how I did it at least. I am using IX mysql and they do use old auth on their server so you must do something on your end...

NOTE: If anyone does know of a way to accomplish what I originally asked, please let me know. I am still curious if there is a way to pass in the parameter to "useLegacyAuth" or the like. Thanks.



Related Topics



Leave a reply



Submit