Solved

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

Posted on 2014-12-22
20
2,257 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:dvonderburg
  • 9
  • 7
  • 3
20 Comments
 
LVL 23

Expert Comment

by:Michael74
Comment Utility
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:dvonderburg
Comment Utility
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
Comment Utility
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
 
LVL 1

Author Comment

by:dvonderburg
Comment Utility
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
Comment Utility
OK, I am out of suggestions. I would hit request attention and ask other experts for their input
0
 
LVL 76

Accepted Solution

by:
arnold earned 500 total points
Comment Utility
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:dvonderburg
Comment Utility
We are running 5.0.9 currently.

We are staying with 32 bit application.
0
 
LVL 76

Assisted Solution

by:arnold
arnold earned 500 total points
Comment Utility
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:dvonderburg
Comment Utility
@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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 76

Assisted Solution

by:arnold
arnold earned 500 total points
Comment Utility
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:dvonderburg
Comment Utility
@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 76

Expert Comment

by:arnold
Comment Utility
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:dvonderburg
Comment Utility
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 76

Expert Comment

by:arnold
Comment Utility
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:dvonderburg
Comment Utility
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 76

Expert Comment

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

Author Comment

by:dvonderburg
Comment Utility
That one has a drop down with True/False. I tried both and same error.
0
 
LVL 76

Expert Comment

by:arnold
Comment Utility
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:dvonderburg
Comment Utility
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Foreword In the years since this article was written, numerous hacking attacks have targeted password-protected web sites.  The storage of client passwords has become a subject of much discussion, some of it useful and some of it misguided.  Of cou…
Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
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…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

743 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now