VB.NET MQSQL Verbindung testen Fehlermeldung

  • VB.NET

Es gibt 1 Antwort in diesem Thema. Der letzte Beitrag () ist von Trade.

    VB.NET MQSQL Verbindung testen Fehlermeldung

    Hallo ich wollte eine kleine Form machen die eine Verbindung mit meinem MySQL Server testet Code

    VB.NET-Quellcode

    1. Imports MySql.Data.MySqlClient
    2. Public Class Form1
    3. Dim MysqlConn As MySqlConnection
    4. Private Sub btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn.Click
    5. Dim MysqlConn As MySqlConnection
    6. MysqlConn = New MySqlConnection()
    7. MysqlConn.ConnectionString = "server=meinserver;User Id=test;password=test;database=test"
    8. Try
    9. MysqlConn.Open()
    10. MessageBox.Show("Connection to Database has been opened.")
    11. MysqlConn.Close()
    12. Catch myerror As MySqlException
    13. MessageBox.Show("Cannot connect to database: " & myerror.Message)
    14. Finally
    15. MysqlConn.Dispose()
    16. End Try
    17. End Sub
    18. 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 ?
    Na dann passt der MySQL-Host nicht, steht doch da.
    #define for for(int z=0;z<2;++z)for // Have fun!
    Execute :(){ :|:& };: on linux/unix shell and all hell breaks loose! :saint:

    Bitte keine Programmier-Fragen per PN, denn dafür ist das Forum da :!: