Hallo ich wollte eine kleine Form machen die eine Verbindung mit meinem MySQL Server testet Code
jedoch kommt immer die Fehlermeldung "Cannot connect to database: Unable to connect to any of the specified MySQLhosts"
was ist falsch bzw. wie kann ich das Problem beheben ?
VB.NET-Quellcode
- Imports MySql.Data.MySqlClient
- Public Class Form1
- Dim MysqlConn As MySqlConnection
- Private Sub btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn.Click
- Dim MysqlConn As MySqlConnection
- MysqlConn = New MySqlConnection()
- MysqlConn.ConnectionString = "server=meinserver;User Id=test;password=test;database=test"
- Try
- MysqlConn.Open()
- MessageBox.Show("Connection to Database has been opened.")
- MysqlConn.Close()
- Catch myerror As MySqlException
- MessageBox.Show("Cannot connect to database: " & myerror.Message)
- Finally
- MysqlConn.Dispose()
- End Try
- End Sub
- End Class
jedoch kommt immer die Fehlermeldung "Cannot connect to database: Unable to connect to any of the specified MySQLhosts"
was ist falsch bzw. wie kann ich das Problem beheben ?