0
我試着使用MySQL連接器vb.net,但我得到了同樣的錯誤永遠是MySQL連接
無法連接特定的主機
我使用此代碼:
Imports MySql.Data.MySqlClient
Imports MySql.Data
Imports MySql
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim myConnectionString As String
myConnectionString = "server=example.net;" _
& "uid=example_support;" _
& "pwd=passwordhere;" _
& "database=example_support;"
Try
Dim conn As New MySql.Data.MySqlClient.MySqlConnection(myConnectionString)
conn.Open()
Catch ex As MySql.Data.MySqlClient.MySqlException
Select Case ex.Number
Case 0
MessageBox.Show("Cannot connect to server. Contact administrator")
Case 1045
MessageBox.Show("Invalid username/password, please try again")
Case Else
MessageBox.Show(ex.Message)
End Select
End Try
End Sub
End Class
這個錯誤有什麼可能的問題?