Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2014-12-22
20
Medium Priority
?
3,031 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:Michael Fowler
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:Michael Fowler
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
What Is Blockchain Technology?

Blockchain is a technology that underpins the success of Bitcoin and other digital currencies, but it has uses far beyond finance. Learn how blockchain works and why it is proving disruptive to other areas of IT.

 
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:Michael Fowler
ID: 40515814
OK, I am out of suggestions. I would hit request attention and ask other experts for their input
0
 
LVL 79

Accepted Solution

by:
arnold earned 2000 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 79

Assisted Solution

by:arnold
arnold earned 2000 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 79

Assisted Solution

by:arnold
arnold earned 2000 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 79

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 79

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 79

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 79

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

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

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

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This post contains step-by-step instructions for setting up alerting in Percona Monitoring and Management (PMM) using Grafana.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

705 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