Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3285
  • Last Modified:

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.
0
Don VonderBurg
Asked:
Don VonderBurg
  • 9
  • 7
  • 3
3 Solutions
 
Michael FowlerSolutions ConsultantCommented:
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
 
Don VonderBurgPresident/CEOAuthor Commented:
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
 
Michael FowlerSolutions ConsultantCommented:
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Don VonderBurgPresident/CEOAuthor Commented:
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
 
Michael FowlerSolutions ConsultantCommented:
OK, I am out of suggestions. I would hit request attention and ask other experts for their input
0
 
arnoldCommented:
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
 
Don VonderBurgPresident/CEOAuthor Commented:
We are running 5.0.9 currently.

We are staying with 32 bit application.
0
 
arnoldCommented:
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
 
Don VonderBurgPresident/CEOAuthor Commented:
@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
 
arnoldCommented:
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
 
Don VonderBurgPresident/CEOAuthor Commented:
@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
 
arnoldCommented:
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
 
Don VonderBurgPresident/CEOAuthor Commented:
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
 
arnoldCommented:
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
 
Don VonderBurgPresident/CEOAuthor Commented:
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
 
arnoldCommented:
On page 5 there is the use old syntax option try that.
0
 
Don VonderBurgPresident/CEOAuthor Commented:
That one has a drop down with True/False. I tried both and same error.
0
 
arnoldCommented:
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
 
Don VonderBurgPresident/CEOAuthor Commented:
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 9
  • 7
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now