3

Authentication method caching_sha2_password not supported by any of the available plugins. image

How can I fix this? or do I need to use another SQL Server?

I don't know what's the problem if it's the installation of MySQL Server or just the code I'm using, I also added MySQL.Data on the reference still not working.

This is the code:

Imports MySql.Data.MySqlClient

Public Class PIS

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

    cn.ConnectionString = "server=localhost; userid=circuit; password=password; database=pis;"
    cn.Open()
    MsgBox("Connected")
    switchpanel(search)

End Sub

End Class
Dids
  • 137
  • 2
  • 2
  • 18
  • Did you try to search for the exact error message words? There are many links here and in external sites that explain the possible reasons for this message. – Steve Feb 22 '19 at 10:50
  • yes i tried to, there are suggestions to update mysql-connector, but when i updated it, it also gave me error that the framework is not supported – Dids Feb 22 '19 at 10:56

4 Answers4

2

My reputation is too low to add as comment. Here a similar problem faced by other user.

Authentication plugin 'caching_sha2_password' cannot be loaded

  • I tried those steps too, my workbench is working, the only problem is when i import MySql.Data.MySqlClient to the Visual Studio the syntax .Open() is not working and it shows the error above. Is it possible that my Visual Studio version is old that's why it caused the error? – Dids Feb 22 '19 at 11:54
  • what is your version of MySql Nuget package? You need to update the version 8.0.x or later. – Edwin Koh Feb 22 '19 at 13:00
  • i'm using the latest version of MySql Nuget package – Dids Feb 23 '19 at 07:37
  • i think the problem is that i'm using old versions of Visual Studio, and latest version of MySql Server, it does not support caching_sha2_password, any suggestions for a new SQL Server that's easy to use in Visual Studio? – Dids Feb 23 '19 at 07:39
0

I solved the problem by updating .NET FRAMEWORK target value to 4.5.2

Dids
  • 137
  • 2
  • 2
  • 18
0

To solve this problem, you have to update the mysql connector:

  1. go to https://dev.mysql.com/downloads/installer/
  2. download mysql-installer-community-8.0.xx.xx.msi
  3. run the msi file to update the connector
  4. At Visual Studio > Solution Explorer > Reference, remove MySql.Data (old reference) and add the new one (version 8.0.xx)

Hope to help somebody.

0

I needed a local Mysql server to test entity framework 6 database generation with code first. I got this error trying to add a new migration.

enter image description here

When setting up Mysql Server, you can choose two kind of authentification methods:

  • Strong password encryption (new secure method)
  • legacy anthentification method

Reconfiguring my server with Mysql Installer solved the problem for me using the legacy anthentification method. And I'm using .net framework 4.5.1.

Ben
  • 501
  • 6
  • 20