MySQL Connection failed

  • VB.NET

Es gibt 5 Antworten in diesem Thema. Der letzte Beitrag () ist von greetz90.

    MySQL Connection failed

    Hallo,
    ich versuche micht mit meinem Programm (Visual Basic 2010) mit einer MySQL Datenbank zu verbinden.
    Doch es kommt jedes Mal der selbe Fehler ohne Ladezeit: Unable to connect to any of the specified MySQL hosts.

    VB.NET-Quellcode

    1. Imports MySql.Data.MySqlClient
    2. Public Class login
    3. Dim sqlconn As MySqlConnection
    4. Private Sub bt_login_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_login.Click
    5. sqlconn = New MySqlConnection
    6. sqlconn.ConnectionString = "server=mysql.hostinger.de;userid=<myuserid>;password=<mypw>;database=db_test"
    7. Try
    8. sqlconn.Open()
    9. MessageBox.Show("Connected.")
    10. sqlconn.Close()
    11. Catch ex As Exception
    12. MessageBox.Show(ex.Message)
    13. Finally
    14. sqlconn.Dispose()
    15. End Try
    16. End Sub
    17. End Class


    Bei Userid, passwort und datenbank bin ich mir sicher dass es richtige angaben sind, aber ist der Server richtig?

    danke im voraus!
    Hi @greetz90,

    probier mal, den ConnectionString mit dem MySQLConnectionStringBuilder zu erzeugen. Der ist meinst zuverlässiger und spuckt dir garantiert das richtig aus(sofern korrekte Eingaben gemacht wurden).

    Lg Radinator
    In general (across programming languages), a pointer is a number that represents a physical location in memory. A nullpointer is (almost always) one that points to 0, and is widely recognized as "not pointing to anything". Since systems have different amounts of supported memory, it doesn't always take the same number of bytes to hold that number, so we call a "native size integer" one that can hold a pointer on any particular system. - Sam Harwell
    Jo, da bleibt dann nur der Weg über PHP.

    Grüße
    #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 :!:

    Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von „Trade“ ()