Solved

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

Posted on 2014-12-22
20
2,641 Views
Last Modified: 2015-01-01
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.
0
Comment
Question by:Don VonderBurg
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 9
  • 7
  • 3
20 Comments
 
LVL 23

Expert Comment

by:Michael74
ID: 40514341
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
0
 
LVL 1

Author Comment

by:Don VonderBurg
ID: 40514792
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?
0
 
LVL 23

Expert Comment

by:Michael74
ID: 40515565
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
0
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
LVL 1

Author Comment

by:Don VonderBurg
ID: 40515796
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.
Capture2.PNG
0
 
LVL 23

Expert Comment

by:Michael74
ID: 40515814
OK, I am out of suggestions. I would hit request attention and ask other experts for their input
0
 
LVL 78

Accepted Solution

by:
arnold earned 500 total points
ID: 40520149
The issue with your first myadmin user is that it does not have the requisite permissions to alter the settings which are host based not on a per database basis.
Double check the function/method/interaction you are using in the code.

What is the version of mysql to which you want this application to connect?
select @@version;

are you also transitioning from a 32bit app Vb@2010 to a 64bit app @2013?
0
 
LVL 1

Author Comment

by:Don VonderBurg
ID: 40520447
We are running 5.0.9 currently.

We are staying with 32 bit application.
0
 
LVL 78

Assisted Solution

by:arnold
arnold earned 500 total points
ID: 40520557
I think somewhere within your code you are setting old_password=0 which might be where your issue begins.

if you run the query directly via phpmyadmin
select * from table where password=Password('<password>';
what do you get?
Somewhere within your connection definition you might be setting the stage that you want to use the old_password mechanism.
0
 
LVL 1

Author Comment

by:Don VonderBurg
ID: 40520577
@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
0
 
LVL 78

Assisted Solution

by:arnold
arnold earned 500 total points
ID: 40520615
Do not use OLD_PASSWORD this is where your error comes from. you could try length(password) as a check the newer method will match.
Check the connection string settings to see what it is passing. The old_password selection must still be in there since that is what your code seems to try to pass.

Ref http://dev.mysql.com/doc/connector-net/en/connector-net-programming-connecting-connection-string.html
Follow to the .net connection string options to see which you have selected.  There is a reference to old syntax use, useoldsyntax, etc.
Something within your side you direct the mode and that is where the ..........
0
 
LVL 1

Author Comment

by:Don VonderBurg
ID: 40520627
@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
0
 
LVL 78

Expert Comment

by:arnold
ID: 40520637
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.
0
 
LVL 1

Author Comment

by:Don VonderBurg
ID: 40520692
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.
0
 
LVL 78

Expert Comment

by:arnold
ID: 40521018
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?
0
 
LVL 1

Author Comment

by:Don VonderBurg
ID: 40521033
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
0
 
LVL 78

Expert Comment

by:arnold
ID: 40521177
On page 5 there is the use old syntax option try that.
0
 
LVL 1

Author Comment

by:Don VonderBurg
ID: 40521187
That one has a drop down with True/False. I tried both and same error.
0
 
LVL 78

Expert Comment

by:arnold
ID: 40521217
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.
0
 
LVL 1

Author Closing Comment

by:Don VonderBurg
ID: 40526692
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.
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question