Click here to Skip to main content
15,905,420 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am having serious problems with connecting to a MySQL server hosted by IX_WebHosting. I have communicated with the support group and requested that they update their server to a current version, but they refuse to do so because it will affect everybody who connects to the server. They replied, "It appears that your version of Mysql Workbench does not have authentication option configurable. I can recommend to download latest version from the developer's website which has this option available. This will allow you to authenticate on the MySQL server using old authentication with MySQL Workbench. It won't be possible to create users with new authentication types though as "old_passwords" option on the MySQL server is global and can't be changed for one user. I've searched for .NET Connector 6.8.3 documentation but was unable to find any information on the authentication method used by it. I recommend testing connection and using a different driver if it fails." I am able to connect to their server with Workbench now by setting the option to connect using the old authentication method. My question is "How do I connect to a MySQL server that uses an old authentication method with a connector (preferably NET or ODBC) that uses a new authentication method?" Thank you in advance for you help with this problem that is halting my work.

My Code is:

Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        DownloadProgramList()
    End Sub

    Private ReadOnly Property MySQL_ConnectionString As String
        Get
            Return "Server=" & MySQL_Server & ";Port=" & MySQL_Port & ";Database=" & MySQL_Database & ";Uid=" & MySQL_User & ";Pwd=" & MySQL_Password & ";"
        End Get
    End Property

    Private Sub DownloadProgramList()
        Dim conMySQL As New MySqlConnection
        conMySQL.ConnectionString = MySQL_ConnectionString
        Try
            conMySQL.Open()
        Catch ex As Exception
            MsgBox(ex.Message, vbInformation)
            End
        End Try

        Dim comPrograms As New MySqlCommand With {.Connection = conMySQL, .CommandType = CommandType.Text, .CommandText = "SELECT * FROM Programs ORDER BY Name"}
        Dim rstPrograms As MySqlDataReader = comPrograms.ExecuteReader

        dtPrograms.Load(rstPrograms)

        If dtPrograms.Rows.Count = 0 Then
            Exit Sub
        End If

        PopProgramList()
    End Sub

    Private Sub PopProgramList()
        lstPrograms.Items.Clear()
        For Each R As DataRow In dtPrograms.Rows
            lstPrograms.Items.Add(R("Name"))
        Next
        lstPrograms.SelectedIndex = 0
    End Sub
Posted
Updated 22-Feb-14 1:24am
v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900