問題的來龍去脈
下載安裝MySQL Connector/Net 6.6.4,在Visual Studio 2012連接至MySQL時會產生錯誤。MySQL Server Version:5.5.23-55。
MySQL連接範例程式碼,主控台應用程式:
Module Module1
Sub Main()
Dim conn As New MySql.Data.MySqlClient.MySqlConnection
Dim ConnString As String = ""
ConnString = "server=x.x.x.x;" _
& "uid=bruce;" _
& "pwd=***********;" _
& "database=?????????;"
Try
conn.ConnectionString = ConnString
conn.Open()
Console.WriteLine("MySql連線成功!")
Catch ex As MySql.Data.MySqlClient.MySqlException
Console.WriteLine("錯誤編號:" & ex.Number)
Console.WriteLine("錯誤訊息:" & ex.ToString())
Finally
conn.Close()
Console.WriteLine("MySql測試完畢!")
End Try
Console.ReadLine()
End Sub
End Module
錯誤編號:0
錯誤訊息:MySql.Data.MySqlClient.MySqlException (0x80004005): Authentication method 'mysql_old_password' not supported by any of the available plugins.
於 MySql.Data.MySqlClient.Authentication.MySqlAuthenticationPlugin.GetPlugin(String method, NativeDriver driver, Byte[] authData)
於 MySql.Data.MySqlClient.Authentication.MySqlAuthenticationPlugin.HandleAuthChange(MySqlPacket packet)
於 MySql.Data.MySqlClient.Authentication.MySqlAuthenticationPlugin.Authenticate(Boolean reset)
於 MySql.Data.MySqlClient.NativeDriver.Open()
於 MySql.Data.MySqlClient.Driver.Open()
於 MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings)
於 MySql.Data.MySqlClient.MySqlPool.CreateNewPooledConnection()
於 MySql.Data.MySqlClient.MySqlPool.GetPooledConnection()
於 MySql.Data.MySqlClient.MySqlPool.TryToGetDriver()
於 MySql.Data.MySqlClient.MySqlPool.GetConnection()
於 MySql.Data.MySqlClient.MySqlConnection.Open()
於 mysql_test_01.Module1.Main() 於 C:\Users\Bruce\Documents\Visual Studio 2012\Projects\mysql_test_01\mysql_test_01\Module1.vb: 行 14
如果使用【伺服器總管】【資料連接】方式,當輸入完所有資訊按【測試連接】時,會產生一樣錯誤訊息:
Authentication method 'mysql_old_password' not supported by any of the available plugins.
如果按下【確定】更會使Visual Studio 2012 Crash然後重啟。