Link to home
Start Free TrialLog in
Avatar of Don VonderBurg
Don VonderBurgFlag for United States of America

asked on

Authentication with old password no longer supported, use 4.1 style passwords.

I have a desktop application written in vb.net coded in Visual Studio 2010. I am migrating it over to Visual Studio 2013 but I am having issues with the MySQL .Net connector in the VS2013. Opening a new project in VS2013 I create a new dataset and when I connect to the hosted MySQL I get the error "Authentication with old password no longer supported, use 4.1 style passwords." The MySQL server hosted is version 5.0.9. The current MySQL .Net connector in VS2013 is 6.5.7. My old VS2010 connector is 6.3.6 and works. I have tried the SQL statements "SET PASSWORD for <username> = PASSWORD('new password')" which I found on many Google searches and that has not worked.
Avatar of Michael Fowler
Michael Fowler
Flag of Australia image

In your mySQL workbench run the following commands

SET SESSION old_passwords=0;
SET PASSWORD FOR my_user=PASSWORD('my_password');

Open in new window


Replace my_user and my_password to your settings
Avatar of Don VonderBurg

ASKER

Michael74 - Thank you for answering. I've tried that.

In the MySQL Workbench I get:

    Error Code: 1044. Access denied for user 'myadminuser'@'%' to database 'mysql'

In the phpMyAdmin web control I get:

    #1044 - Access denied for user 'myuser'@'localhost' to database 'mysql'

If I log into the myPhpAdmin as the user I wish to set and run:

    SET SESSION old_passwords=0;
    SET PASSWORD=PASSWORD('mynewpassword');

I get:

    SET SESSION old_passwords=0;# MySQL returned an empty result set (i.e. zero rows).
    SET PASSWORD=PASSWORD('mynewpassword');# MySQL returned an empty result set (i.e. zero rows).

And none of these affect the VB.NET application. I still get the Authentication error. I am tempted to ask the hosting service to upgrade the MySQL to the latest version. My fear is if I have them upgrade the MySQL server would everyone running the Windows desktop application we have deployed start having issues?
Some solutions I have seen or could suggest

Change the MySql Connector/NET library from version 6 to version 5
Run the commands listed previously a number of times as I have seen reports that sometimes it takes a few runs to work

Question: in 2010 which version of .Net are you using. You could try downgrading the target version of .Net in 2013
I've been attempting to downgrade in my .Net 2013 but after installing "mysql-connector-net-6.3.6.msi" it does not appear in the data connections list in VS2013. I think the 6.3.6 will only install to VS2010. Unless there is a way I can force the IDE to see the MySQL in the data connection list.
User generated image
OK, I am out of suggestions. I would hit request attention and ask other experts for their input
ASKER CERTIFIED SOLUTION
Avatar of arnold
arnold
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
We are running 5.0.9 currently.

We are staying with 32 bit application.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
@arnold
I am using Visual Studio 2013 and in a desktop application source I add a new dataset item. I attempt to add a new table adapter and select the MySQL for the new connection data source. After filling out the connection information I click test connection and that is when the error occurs. So there are no code lines to edit to that have old_password, etc.

When I run the select statement in phpmyadmin it throws and error.

If I run the query:
SELECT LENGTH( OLD_PASSWORD(  'password' ) );
The answer is 16

If I run the query:
SELECT LENGTH(PASSWORD(  'password' ) );
The answer is 16
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
@arnold
In adding a table adapter I am not getting to the point to edit the connection string. I fill in the GUI form with the credentials and click test. After a successful test I would opportunity to edit the connection string in the resources. That is the way I did it in the VS2010 which works perfectly.
Capture3.PNG
Capture4.PNG
See the advanced button, what do you have available there? Capture3.png

in the connection, do you specify the database name as well?
When the user connecting does not have rights to the system database, mysql
the authentication method requires the username, password and the database to which the user has rights when there is no database that allows all users.
In the Advance there are many fields to enter text or select from drop downs. I have tried countless options and settings. There is one field called connection string but typing anything in there produces an error when any attempt to leave the field or close.

I have specified the database too. I've tried it both with and without.

Using Workbench and the user I am attempting in the project, I use I can connect by selecting "use the old authentication protocol". There is no option in the DDEX of the MySQL .Net connection that I can find to give me the same.
Th link I pored from mysql has examples of connection things to include the plugin reference.
In the workbench, if you o not specify the use old password, do you get this error as well when connecting?

Do you have multiple databases on the mysql server?

Could you post the image of the advanced options?
arnold - thank you so much for your dedication. Attached are the 5 pages of advanced options available in the MySQL DDEX. And yes if I change the authentication mode in the Workbench I get a similar error message.
Page1.PNG
Page2.PNG
Page3.PNG
Page4.PNG
Page5.PNG
Page6.PNG
On page 5 there is the use old syntax option try that.
That one has a drop down with True/False. I tried both and same error.
Look page 4 connection protocol options.
Look on page 6 password option.

Alternatively, see whether you can have those who host your mysql adjust their config.
Arnold - you were a big help and devoted lots of time to this. Thank you! You got me on the right track and it took the hosting company to make changes to the MySQL config to allow long hash passwords. Now I can have the old password 16 bit hash work with the older software and create new users with long hash for future software releases.