Dim conn As New MySql.Data.MySqlClient.MySqlConnection
If conn.State = ConnectionState.Closed Then
Dim myString As String = "server=localhost;user=root;password=;database=dbname"
Try
conn.ConnectionString = myString
conn.Open()
Catch ex As MySql.Data.MySqlClient.MySqlException
MsgBox(ex.Message)
End
End Try
End If

Dim conn As New MySql.Data.MySqlClient.MySqlConnection
If conn.State = ConnectionState.Closed Then
Dim myString As String = "server=localhost;user=root;password=;database=dbname"
Try
conn.ConnectionString = myString
conn.Open()
Catch ex As MySql.Data.MySqlClient.MySqlException
MsgBox(ex.Message)
End
End Try
End If