Quantcast
Channel: sshnet Discussions Rss Feed
Viewing all articles
Browse latest Browse all 1729

New Post: Hang connecting to MYSQL

$
0
0

John,

I used your code and implemented mysql ports but I am getting this error "A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond"

Does not seem like an error with SSH.Net portforwarding (forward to port localhost:81 works for example) I can connect to my mysql using putty. What ports did you use for mysql connection? Could you check for this error if you have time?

P.S I did not input info into text boxes

Thanks

Ben

using (client == new SshClient("IP", portnumber, "username", "password")) {
    client.Connect();object port = new ForwardedPortLocal("127.0.0.1", 3306, "localhost", 3306);
    client.AddForwardedPort(port);

    port.Start();

    string connstr = "server=localhost;user=;database=;port=3306;password=;";using (MySqlConnection conn = new MySqlConnection(connstr)) {
        conn.Open();
        MessageBox.Show("Connected to mysql");
        conn.Close();
    }
    port.Stop();
    client.Disconnect();
}

 


Viewing all articles
Browse latest Browse all 1729

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>